Sub topic 16
Clipping a Layer to the One Below
This chapter assumes you can create and select layers, you know that layers composite from the bottom of the stack to the top, and you have used opacity and blend modes at a basic level. It covers how a clipping mask works, how to make and release one, and the errors that most often surprise people.
What a clipping mask does
A clipping mask makes one layer visible only where the layer beneath it has pixels. The lower layer is the base layer. The layers clipped to it are the clipped layers. The base layer's opacity and transparency act as a stencil for everything clipped to it.
Photoshop reads the base layer's pixels as a stencil, and it uses that layer's transparency and not its color. Fully opaque pixels let the clipped layer show completely. Fully transparent pixels hide it. Partly transparent pixels, such as a soft edge, show the clipped layer partly.
This is different from a layer mask. A layer mask is attached to one layer and hides parts of that same layer. A clipping mask uses a different layer as the boundary, so you can change the shape by editing the base layer, and you can clip several layers to the same shape.
| Feature | Layer mask | Clipping mask |
|---|---|---|
| What defines the visible area | A grayscale mask attached to the layer | The pixels of the layer below |
| Affects | Only the layer that owns the mask | Every layer clipped to the base |
| How you edit the shape | Paint on the mask | Edit the base layer's pixels, text, or shape |
| Panel appearance | A mask thumbnail beside the layer | Indented layer with a small arrow, base name underlined |
Making a clipping mask
Suppose you have a type layer reading "SUMMER" and a photo layer above it. You want the photo to show only inside the letters.
- Place the photo layer directly above the type layer in the Layers panel.
- Select the photo layer.
- Choose Layer > Create Clipping Mask, or press Alt+Ctrl+G (Windows) or Option+Command+G (macOS).
You can also hold Alt (Windows) or Option (macOS) and click the line between the two layers in the Layers panel. The pointer changes to a small square with a down-pointing arrow when you are over the right spot.
After clipping, the photo layer is indented and shows a small arrow pointing down at the base layer. The base layer's name is underlined. Nothing is deleted. The photo still has all its pixels, and the clipping only hides the parts outside the base.
Releasing a clipping mask
To undo the clip, select a clipped layer and choose Layer > Release Clipping Mask, or press the same shortcut again. You can also Alt or Option click the line between the layers a second time. Releasing a layer in the middle of a clipped stack also releases every clipped layer above it, because those layers were clipped to a chain that now has a break.
Clipping several layers to one base
You can clip more than one layer to the same base. Stack them directly above the base and clip each one. They all form a single clipping group.
A common pattern is to clip a photo, a color adjustment, and a shadow layer to one shape:
- Base layer: a shape layer or a pixel layer holding the silhouette.
- Clipped layer 1: the photo.
- Clipped layer 2: a Curves adjustment layer that changes only the photo's tone.
- Clipped layer 3: a pixel layer with painted shading.
Because the adjustment is clipped, it affects only the layers in the clipping group below it, and not the whole document. This is the main reason intermediate users reach for clipping. It scopes an adjustment layer to one element without a mask.
How blend modes behave in a clipping group
By default, the base layer's blend mode applies to the whole clipping group. Clipped layers composite against the base first, and then the combined result composites with the layers below. This default comes from a layer option called Blend Clipped Layers as Group.
This has a visible effect. If the base layer is set to Multiply, the clipped layers are treated as part of that Multiply result. If a clipped layer uses its own blend mode, such as Overlay, it interacts only with the layers in the group up to and including the base. It does not reach the layers below the group.
If you turn that option off, the base layer's blend mode applies only to the base layer itself, and the clipped layers can blend with everything below. To change it, double-click the base layer to open Layer Style, then open Blending Options and find Blend Clipped Layers as Group in the Advanced Blending section.
Opacity is similar. Lowering the base layer's opacity fades the whole clipping group, because clipped layers can never be more visible than their base.
Common problems
- The clipped layer disappears. The base layer may be empty, fully transparent, or hidden. Turning off the base layer's visibility hides the entire clip. Check that the base has pixels where you expect.
- The clip shows a hard or jagged edge. The base layer has a hard edge. Feather or soften the base layer's edge, or use a base with a soft transparent edge.
- The wrong layer is clipped. Clipping always targets the layer directly below the selected one. Check the stacking order.
- The Background layer cannot be a clipped layer. The Background layer is locked at the bottom of the stack and has no transparency. It cannot be clipped to anything. It can be a base, but it is fully opaque, so it shows the clipped layers everywhere. Convert it to a regular layer if you want transparency.
- A clipped layer will not move with the base. Clipping does not link layers. If you move the base, the clipped layers stay in place, and the visible area shifts across them. Link the layers or put them in a group if they should move together.
- Merging changes the result. Merging a clipped layer down into its base bakes the clip into pixels. The clipped content outside the base is discarded for good.
Clipping and groups
A clipping group can live inside a layer group. Keep the base and its clipped layers together in the same group so the relationship is not broken when you reorder.
Clipping also works with groups in a limited way. A group can act as a clipped layer. If you place a group directly above a base layer and clip it, everything inside the group is restricted to the base's shape. A group cannot act as a base for layers outside it, so the stencil is always a single layer, not a group's combined shape.
Scripting a clip
In ExtendScript, a layer has a grouped property. Setting it to true is the same as choosing Create Clipping Mask on that layer.
// ExtendScript (.jsx): clip the active layer to the layer below it
var doc = app.activeDocument;
var layer = doc.activeLayer;
layer.grouped = true;Setting grouped to false releases the clip. As with the interface, the layer must sit directly above its base, so move it into place first.
Exercise
You clip a photo layer to a type layer. You then lower the type layer's opacity to 50% and set a Curves adjustment layer, also clipped, above the photo. What happens to the photo's visibility, and which layers does the Curves adjustment change?
Show answer
The photo becomes 50% visible, because a clipped layer can never be more visible than its base. The Curves adjustment changes only the photo, since it is clipped and affects only the layers in the clipping group below it.
Exercise
A clipped layer vanishes after you hide the layer directly beneath it in the stack, which is the base. You want to see the clipped layer's content again without un-hiding the base. What can you do?
Show answer
Release the clipping mask so the layer no longer depends on the base. Hiding a base hides the whole clip, so the layer returns to normal visibility only after it is released, or after the base is made visible again.