• 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 - the clipping mask

Doug Kerr

Well-known member
A very useful functionality of Photoshop is the clipping mask. But it took me a while to figure out exactly how it works. The Photoshop Help for it just makes my head hurt.

How it works and what it does

Note that in the basic story here, no layer masks are involved.​

A clipping mask is a "normal" (content) layer that has been given a special power. Its own pixel content is not normally seen, and does not normally ever enter into the image buildup.

But the opacity of this layer, pixel-by-pixel, is conferred on the content layer above.

Assume for simplicity's sake in the following that the basic opacity of the content layer above, and of the pixels of its content, is 100%.​

Wherever the special layer is 100% opaque, the layer above acts as if it is 100% opaque. Thus, its pixels participate in the image buildup; they will "cover up" the pixels of a layer below the special layer.

Wherever the special layer is 0% opaque, the layer above acts as if it is 0% opaque. Thus, its pixels do not participate in the image buildup; they will "cover up" the pixels of a content layer below the special layer.

Wherever the special layer is (for example) 30% opaque, the layer above acts as if it is 30% opaque. Thus, its pixels participate in the image buildup at "30% of par"; they will "30% cover up" the pixels of a content layer below the special layer (such that they participate in the image buildup at 70% of par.

Note that the pixel colors in the special layer have no effect on this, only their transparency.

Setting this up

To put this deal into effect, we can:

• Right click on the control bar for the layer above the one to be made a clipping layer (the layer whose content is to be affected by the clipping mask); click on Create Clipping Mask.

or

• Alt-click on the boundary between the "layer to be governed" and "the layer to be made a clipping mask".

Once we have done this, the layer to be governed shows a "left then down" bent arrow. That says, "look down there: that is my boss".

An alternate description

There is an alternate way to describe what happens here:

• The pixels on the layer above the special layer never appear in the image buildup.

• The pixels of the special layer are replaced by the pixels of the layer above with respect to pixel color, but retain the opacity of the original inhabitants of the special layer. Those immigrant pixels then participate in the layer buildup in the usual way.

Thus, only where those immigrant pixels have an opacity greater than 0% (which is where the original content of the special layer had an opacity greater than 0%) will they be seen.

Best regards,

Doug
 

Jonas Wendorf

New member
Another interesting thing about the use of clipping masks is that they by default blend as a group.

That means if your base layer (the special layer as you call it) is set to any blending mode different to normal, the two clipped layers will first of all interact with each other in the according way and afterwards the result will blend with the special layer's blending mode.

If for some reason you want to change this behavior (if for example you've got a layer with a mask attached and need this mask on another layer, but with a different blending mode), you can just go to the special layer's advanced blending options and uncheck the "Blend clipped layers as Group" checkbox.
 

Asher Kelman

OPF Owner/Editor-in-Chief
Doug,

An example would be really helpful. Looking at an actual photograph that has changed as a picture result of a clipping mask, (screen capture of the layers dialog box), would be a nice reinforcement of your text.

Asher
 

Doug Kerr

Well-known member
Hi, Asher,

An example would be really helpful. Looking at an actual photograph that has changed as a picture result of a clipping mask, (screen capture of the layers dialog box), would be a nice reinforcement of your text.

Yes, indeed. I hope to be able to add that soon.

Thanks.

Best regards,

Doug
 

Doug Kerr

Well-known member
Here we see an example of the operation of a basic Photoshop clipping mask. It is not a realistic example of something we might do. It is a didactic example, intended to most clearly show what does what.

The setup has three layers. The top (3) and bottom (1) have content (trivial, but easily recognized for this example). The center one (2) also has content, but it is the layer that will be made a clipping mask (called the "base layer" of a clipping mask setup.

There are no layer masks in effect.

Here we see layer 3 with the clipping mask not yet activated:

Clip_mask_01-01.jpg

Layer 3 with no clipping mask in effect​

Here we see layer 2 before it has been made a clipping mask:

Clip_mask_01-02.jpg

Layer 2 before it is made a clipping mask​

It is important to note that the various colors in the cross have normal opacity (100%), while the surrounding area has opacity 0% (and so there we can see right through to "the great empty beyond", indicated by the symbolic gray checkerboard).

Here we see layer 1:

Clip_mask_01-03.jpg

Layer 1​

Here we see layer 3 as modified by the effect of layer 2 once it has been made a clipping mask:

Clip_mask_01-05.jpg

Layer 3 as clipped by layer 2​

We see that wherever layer 2 has opacity 100%, the pixels of layer 3 retain their original opacity, 100%. Where layer 2 has opacity 0%, the pixels of layer 3 are given opacity 0% (and are thus invisible, since we see right through them to the great empty beyond). But all the pixels on layer 3 retain their original colors.

Note that the particular colors of the pixels in layer 2 do not matter, just their opacity.

[continued]
 

Doug Kerr

Well-known member
[continued]

Here we see the composite image:

Clip_mask_01-04.jpg

Composite image​

As we might expect, the pixels in layer 3 that have opacity 100% (conferred on them by layer 2) are seen; they "cover up" the pixels of layer 1. The pixels of layer 3 that have opacity 0% (conferred on them by layer 2) are not seen; we see right through them to the pixels of layer 1.

Here we see the Layers panel with this setup in effect:

Clip_mask_01-06.jpg

Layers panel​

The hooked arrow on the layer 3 control bar indicates that there is a clipping mask below that influences this layer. The underlined title of layer 2 shows that it is a clipping layer.

Best regards,

Doug
 

Joachim Bolte

New member
If I am correct, another nice thing about a clipping mask is that it, though not showing the pixels of the object, does supports layer styles on the clipping mask itself. So when making (for example) a photo-collage in a single document, you could use square clipping masks to frame your pictures, and a 'stroke' and 'drop shadow' layer style to give every picture a white edge and a bit of depth. You could position the originals behind the clipping mask, shove them around at your liking, without having to bother about resizing and reframing.

An example for this that I did can be found here:
8FAE8C29712F4D829E8F143C2B0B15A6.jpg
 

Doug Kerr

Well-known member
Hi, Joachim,

If I am correct, another nice thing about a clipping mask is that it, though not showing the pixels of the object, does supports layer styles on the clipping mask itself. So when making (for example) a photo-collage in a single document, you could use square clipping masks to frame your pictures, and a 'stroke' and 'drop shadow' layer style to give every picture a white edge and a bit of depth. You could position the originals behind the clipping mask, shove them around at your liking, without having to bother about resizing and reframing.
That is a great tip, and your example is wonderful.

Thanks so much.

Best regards,

Doug
 

Doug Kerr

Well-known member
Hi, Joachim,

An example for this that I did can be found here:
8FAE8C29712F4D829E8F143C2B0B15A6.jpg
I would very much appreciate it if you could describe for me the layer setup you used to do this. I still do not think fluently in terms of clipping masks or many other "layer" things.

Thanks.

Best regards,

Doug
 

Asher Kelman

OPF Owner/Editor-in-Chief
If I am correct, another nice thing about a clipping mask is that it, though not showing the pixels of the object, does supports layer styles on the clipping mask itself. So when making (for example) a photo-collage in a single document, you could use square clipping masks to frame your pictures, and a 'stroke' and 'drop shadow' layer style to give every picture a white edge and a bit of depth. You could position the originals behind the clipping mask, shove them around at your liking, without having to bother about resizing and reframing.

An example for this that I did can be found here:
8FAE8C29712F4D829E8F143C2B0B15A6.jpg

Joachim,

I love this! What a short cut to expensive, hard to get, Polaroid's! This is is so artistic. Who does this as a style? I've seen total collages like this but not as you've shown/

Asher
 

Doug Kerr

Well-known member
Hi, Joachim,

Well, I think I got it.

I made a (full-color) copy of the background image for each "framed picture". I gave each one a clipping mask, made a rectangular block in each clipping layer, and then applied a layer Stroke (inside - white) and a bevel.

Are we on the same page?

Thanks.

Best regards,

Doug
 

Jonas Wendorf

New member
If I may throw in my opinion once again ;-).
Images like this are probably easier to create with a knockout layer, rather than clipping masks.

First place your desaturation layer above your background layer.
Then create a new rectangular layer filled with any color you like and apply the layer stiles to create the polaroid look.
The next step is pretty easy.
Go to the advanced blending modes (inside the layer styles dialog), set the knockout to "Deep" and the fill opacity to 0%.
Now this layer will knockout every layer underneath it down to the background layer and therefore reveal the original color image.

The benefit of using this technique is that you just have to copy and paste the knockout layers, not the whole image over and over again :).

If you want an example, I can upload a layered PSD-file for you.

Sorry for the hijack btw!
 

Doug Kerr

Well-known member
Hi, Jonas,

If I may throw in my opinion once again ;-).
Images like this are probably easier to create with a knockout layer, rather than clipping masks.

First place your desaturation layer above your background layer.
Then create a new rectangular layer filled with any color you like and apply the layer stiles to create the polaroid look.
Where and how do we define the sizes, shapes, and locations of the "Polaroid" prints?

Is that done with something working on the arbitrary color layer (a mask, for example)?

Can we have the Polaroids overlapping, as in the original example? How does the style engine know where to put individual the white borders?

Oh - there are multiple "knockout" layers.

The next step is pretty easy.
Go to the advanced blending modes (inside the layer styles dialog), set the knockout to "Deep" and the fill opacity to 0%.
Now this layer will knockout every layer underneath it down to the background layer and therefore reveal the original color image.
Ah, another new thing for me to learn about - knockout!

The benefit of using this technique is that you just have to copy and paste the knockout layers, not the whole image over and over again.

Oh, there are several knockout layers. That clears up my question above. Makes sense of course, but you didn't say!

Well, you don't actually have to Copy and Paste the image layers, just use Duplicate Layer. But I know what you mean.

If you want an example, I can upload a layered PSD-file for you.
That would be wonderful. Let me know where it is when you get it up.

Thanks.

Best regards,

Doug
 

Doug Kerr

Well-known member
Here's an example of using the knockout layers to create this kind of effect.

The real magic is inside the layer stiles (esp. the advanced blending options) :).

http://dl.dropbox.com/u/7124285/Knockout.psd
Fabulous, and what a cute kid.

I'm gratified to see that this is so like what I did myself late last night (based on your description).

See my discussion of that here:

http://www.openphotographyforums.com/forums/showthread.php?t=14114

Thanks.

Best regards,

Doug
 

Joachim Bolte

New member
@Jonas,

Thanks for the tip! indeed a method that requires much less layering and copying of the pictures.

What you might do to make it easier to rescale and rotate the frames without losing quality, is using vector shapes instead of filled pixels. That way you could also make odd shapes like arrows, hearts and so on...
 
Top