• Please use real names.

    Greetings to all who have registered to OPF and those guests taking a look around. Please use real names. Registrations with fictitious names will not be processed. REAL NAMES ONLY will be processed

    Firstname Lastname

    Register

    We are a courteous and supportive community. No need to hide behind an alia. If you have a genuine need for privacy/secrecy then let me know!
  • Welcome to the new site. Here's a thread about the update where you can post your feedback, ask questions or spot those nasty bugs!

Photoshop masks - the "transparency" metaphor

Doug Kerr

Well-known member
The image editing software application Photoshop includes, in various forms and sites, a construct often called a mask. This is a mathematical "map", coextensive with the image, having a single variable, whose value may be different at each pixel location. It will be used to govern many different image manipulation operations.

For the moment, I will ignore the full reality of this, and consider only two possible values of this variable (as if it were a Boolean variable). (That is, I will ignore here the possibility of "semitransparency".)

By rights, we would be safest in considering this to be only a numerical variable, with (under the two-valued limitation I mentioned) two values, "1", and "0". Note that the assignment of those two would still be arbitrary; one way up or the other may seem more logical in one outlook, but the opposite in another.

In practical work with masks in Photoshop, two metaphors (at least) are used to describe, discuss, and in fact specify the manipulation of, this variable. Two of direct importance here are these:

Black/white

In what follows, I will only discuss the Photoshop layer pixel mask. Various things are a bit different for the Selection mask, and I don't want the discussion scrambled by them at this point.​

One way we can "populate" a mask (that is, assign a value of the mask variable at a point, or over a region of points) is to tell the program "we want to paint on the mask" and then, using a painting tool such as a brush, "paint" within the image/mask boundaries.

Where we "paint" with the color white (RGB=255,255,255), we leave the mask in one value (which I will call "W"). Where we "paint" with the color black (RGB=0,0,0), we leave the map in the opposite value (which I will call "B"). Note that these designations have nothing to do with actual colors insofar as the ramifications of the value go; they merely mean "the value we get when painting with the brush color set to white" and "the value we get with the brush color set to black".

Note that one way the program allows us to visualize the current situation of a mask is with a view in which regions with value "B" are shown as black and those with value "W" are shown as white. It is a nice match to our "drawing" convention.

Opaque/Transparent

Many things we do with a mask are evocative, to one degree or another, of things done in optical photographic image processing with a "mask", which we can think of (again holding to a "two-value" outlook) a "plate" part of which is transparent and part opaque. The opaque part might be black paper, and the transparent part holes in the paper. Or the opaque part might be regions on a transparent substrate that are painted with opaque paint (the color doesn't matter), and the transparent part might be the regions on which we did not paint with opaque paint.

Here, the description of the two kinds of mask regions is unequivocal: the transparent regions let light through, the opaque regions don't. Of course the ultimate impact of this on the photographic project depends on how and where the mask is used. But if we have the mask in hand, and want to talk about its two regions, there is no uncertainty.

Because of this familiar situation, we often describe the two states of a mask in Photoshop as being "transparent" and "opaque". But, which is which?

There is one camp that says:

• The portion of the map whose value is that we cause by "painting with black paint" (state "B") should be considered "opaque".

• The portion of the map whose value is that we cause by "painting with white paint" (state "W") should be considered "transparent".

There is another camp that says:

• The portion of the map whose value is that we cause by "painting with black paint" (state "B") should be considered "transparent".

• The portion of the map whose value is that we cause by "painting with white paint" (state "W") should be considered "opaque".

Which of those two outlooks is the most "apt"? In fact, neither is really "accurate". They are just metaphors

For one thing, there is no physical object with physically opaque and transparent regions. More importantly, nothing (maybe almost nothing) we do with a mask in Photoshop exactly parallels what we can do with a mask in optical image handling.

One complication is the matter of pixel opacity, which I will review here.

In an image held in memory in Photoshop, a pixel has (at least) two properties:

• Its color, recorded as values of the coordinates of the working color space.

• Its opacity.

What does the opacity of a pixel mean? It basically means:

• Its ability to be seen (on a scale from "not at all" to "perfectly").

• Its ability to "hide" pixels in lower layers when we are dealing with the Normal blend mode (on a scale from "not at all" to "completely").

A pixel with opacity 100% has the familiar properties. Most pixels we deal with are like this.

A pixel with opacity 0% has been rendered wholly impotent. We cannot see it in any normal image buildup, and if it lies "on top of" a pixel of a lower layer, we don't even know it is there - we "see right through it".

Why are we concerned by this? Because what a mask does to pixels in a layer it does by tampering with their opacity.

Here's a basic example.

We have a layer with an image of Carla standing in front of the piano. Below it, we have a layer with an image of the skyline of London (UK).

On the "Carla" layer we have a layer pixel mask. It is in the "W" state in all the locations that are Carla, and the "B" state in all the locations that are not Carla.

In the composite image, we see Carla in front of the London Skyline. Why?

Where the mask on the Carla layer is in the "W" state, the pixels there are left with their natural opacity (which is probably 100% if we hadn't earlier done anything funny).

Where the mask on the Carla layer is in the "B" state, the pixels there are given opacity 0%.

In the image buildup, the former pixels (Carla) are visible, basically because they are on top of the pixels in the London layer and are wholly opaque (so we do not see any glimpse of the London pixels there). The latter pixels (the piano, not Carla) are not visible, basically because they now have opacity 0% (they are, as pixels, "wholly transparent"), and so we "look right through them", seeing only the London pixels below.

Suppose we didn't have the London layer below at all. Then, the Carla pixels (in the "W" region) are visible because they are fully opaque - we cannot at all "see through them" and so we see them in terms of their actual colors. The piano pixels (in the "W" region) are not visible, basically because they have opacity 0% (they are, as pixels, "wholly transparent"), and so we "look right through them", but seeing what? Well, we look through them into what I call "the great emptiness beyond", which Photoshop represents with a symbolic pattern, normally a gray checkerboard.

Now, gang, should we feel that the "B" regions of the mask are opaque and the "W" regions transparent? Or the opposite? Two opposite outlooks are in vogue. Both are based on the familiar notion that a transparent region lets "something" through, and an opaque region blocks that "something" from getting through. The question is what is that something.

Outlook X: the transparent region of a mask is called that because it "lets through" pixels of the layer it governs (to be seen, and to cover lower pixels if any), and the opaque region is called that because "does not let through" pixels of the layer it governs (to be seen, and to cover lower pixels if any).

Under this outlook the "W" region is properly called transparent, and the "B" region is properly called opaque.

Outlook Y: the transparent region of a mask called that because it "lets through" pixels of the layer below, to be seen, somehow overpowering pixels on its own layer (London pixels, not Carla pixels, survive), and the opaque region is where it blocks pixels on the lower layer, so that pixels on its own layer have no competition and are seen (Carla pixels, not London pixels, survive).

Under this outlook the "B" region is properly called transparent, and the "W" region is properly called opaque.

I myself find "outlook X" more appealing.

Asher assures us that "outlook Y" is "the established convention" in Photoshop circles.

Best regards,

Doug
 

Asher Kelman

OPF Owner/Editor-in-Chief
ss beyond", which Photoshop represents with a symbolic pattern, normally a gray checkerboard.

Now, gang, should we feel that the "B" regions of the mask are opaque and the "W" regions transparent? Or the opposite? Two opposite outlooks are in vogue. Both are based on the familiar notion that a transparent region lets "something" through, and an opaque region blocks that "something" from getting through. The question is what is that something.

Outlook X: the transparent region of a mask is called that because it "lets through" pixels of the layer it governs (to be seen, and to cover lower pixels if any), and the opaque region is called that because "does not let through" pixels of the layer it governs (to be seen, and to cover lower pixels if any). Under this outlook the "W" region is properly called transparent, and the "B" region is properly called opaque.

Outlook Y: the transparent region of a mask called that because it "lets through" pixels of the layer below, to be seen, somehow overpowering pixels on its own layer (London pixels, not Carla pixels, survive), and the opaque region is where it blocks pixels on the lower layer, so that pixels on its own layer have no competition and are seen (Carla pixels, not London pixels, survive).

Under this outlook the "B" region is properly called transparent, and the "W" region is properly called opaque.

I myself find "outlook X" more appealing.

Asher assures us that "outlook Y" is "the established convention" in Photoshop circles.


Let me address "established convention" As I wrote in the current "thin image" correction thread here:


"There's a "religious", almost dogmatic aspect to this discussion, LOL! If one refers to the layer below, then "black reveals and white conceals". That's the perspective from which a lot of us look at masks so perhaps that might be taken into account when describing how the process of building up works with respect to the actual picture, rather than the layer which modulates its appearance! :)

However, in pure Photoshop terms, the reference is exactly as you describe. We refer the changes in the mask correctly to the layer which is masked. "White reveals and black conceals". That's your X option above!

In practice, as I'm always modulating the picture layer underneath. So from that perspective, I think of black revealing, option Y!

If however, one's day job is to extract pictures of Carla, or other beautiful folk from backgrounds, then black hides anything on that layer; metaphor X at work!

Asher
 

Doug Kerr

Well-known member
Hi, Asher,

Let me address "established convention" As I wrote in the current "thin image" correction thread here:


"There's a "religious", almost dogmatic aspect to this discussion, LOL! If one refers to the layer below, then "black reveals and white conceals". That's the perspective from which a lot of us look at masks so perhaps that might be taken into account when describing how the process of building up works with respect to the actual picture, rather than the layer which modulates its appearance! :)

However, in pure Photoshop terms, the reference is exactly as you describe. We refer the changes in the mask correctly to the layer which is masked. "White reveals and black conceals". That's your X option above!

In practice, as I'm always modulating the picture layer underneath. So from that perspective, I think of black revealing, option Y!

Why not!

What is important of course is that we know, or discover, what does what in the various situations we encounter. No simplistic metaphors - "the debits go toward the windows" - can by themselves do that. The overall mesh is to complicated for that, even in simple-sounding tasks.

Thanks for your observations, and your respect for mine.

Best regards,

Doug
 
Top