Sub topic 10
Layer styles and clipping masks together
What this chapter assumes
You should already know how to create and release a clipping mask, and how a base layer controls the clipped layers above it. You should also know how to open the Layer Style dialog, and how Opacity differs from Fill. This chapter covers what happens when the two features meet. Most of the surprises come from one setting and from where each style is attached.
Where a style lives
A layer style belongs to one layer. It is drawn around or on top of that layer's own pixels, not around the clipping group as a whole. That has two consequences.
- A style on the base layer is computed from the base layer's shape. A clipped layer above it does not change what that style looks like by default.
- A style on a clipped layer is computed from that clipped layer's pixels. The clipping then trims the result to the base layer's shape.
The second point causes most confusion. A Drop Shadow on a clipped layer sits outside the clipped layer's edge. Clipping hides everything outside the base layer's opaque area, so the shadow is usually cut off and you see nothing.
Blend Clipped Layers as Group
The Layer Style dialog, on the Blending Options page under Advanced Blending, has a checkbox named Blend Clipped Layers as Group. It is selected by default. It is a setting on the base layer, and it controls how the base layer's blend mode treats the layers clipped to it.
| State | What happens |
|---|---|
| On (default) | The base layer's blend mode applies to the whole clipping group. Clipped layers blend with each other and with the base, and the result of that combination is then blended with the layers below the group, using the base layer's blend mode. |
| Off | The base layer's blend mode affects only the base layer. Each clipped layer keeps its own blend mode and blends against what is beneath it in the group, as if the group were isolated from the layers below. |
In practice, turning it off is how you make a clipped adjustment layer or a clipped Multiply layer behave as expected when the base layer uses an unusual blend mode, such as Overlay or Screen. With the box on, a clipped layer's blend mode is limited by the base layer's. If the base layer is set to anything other than Normal, the clipped layers' blend modes may appear not to work.
Two details are easy to miss:
- When the base layer's blend mode is Normal, the box has little visible effect. The group is composited normally either way.
- The box lives on the base layer only. Selecting a clipped layer and looking for it there will not help.
Opacity and Fill on the base layer
The Opacity and Fill sliders have different effects on a clipping group, and the difference matters when styles are present.
- Opacity on the base layer fades the base, its styles, and, because the group is composited as one unit, the clipped layers as well.
- Fill on the base layer fades the base layer's own pixels but leaves its layer styles at full strength. Clipped layers are affected in a way that depends on the Blend Clipped Layers as Group setting.
You can test the Fill behavior yourself. Put a photo clipped to a shape that has a Stroke. Lower Fill on the shape. The stroke stays, and the clipped photo shows less and less as the base pixels fade. Lowering Opacity instead fades both the stroke and the photo.
A related option is Transparency Shapes Layer, also under Advanced Blending. It is on by default. It makes layer styles such as Drop Shadow and Inner Glow follow the transparency of the layer. If you turn it off, those effects can show in areas where the layer is transparent. This option is useful when you want a glow to keep appearing after you reduced Fill to zero on a shape. For clipping, leave it on unless you know why you are changing it.
Why shadows disappear and how to get them back
A typical request is a photo inside a shape, with the shape casting a shadow. The wrong way is to put the Drop Shadow on the photo. The shadow is clipped away.
The correct way is to put the Drop Shadow on the base layer. The base layer's shape defines the shadow, the shadow falls outside the shape, and clipping affects only the layers above the base, so the shadow is not trimmed.
To get an Inner Shadow that appears over the photo, you have two options.
- Put the Inner Shadow on the base layer, then lower Fill on the base so the base pixels do not hide the photo. This does not work on its own. Inner Shadow on the base is drawn at the base level, and clipped layers draw above the base, so the photo can cover the effect.
- Put the Inner Shadow on the top clipped layer. The shadow is computed from that layer's edges, which only match the base shape if that layer fills the shape exactly.
Neither option is perfect. A more reliable method is to add a separate top layer with its own styles, covered below.
A third approach: a duplicate shape on top
Duplicate the base shape and move the copy above the photo. Set its Fill to 0%. Add the Inner Shadow, Inner Glow, or Stroke to this copy. The copy has the same outline as the base, and with Fill at 0% only its effects are visible, drawn over the photo. This keeps the base layer free for the Drop Shadow and gives you full control of the inner effects.
Style effects on clipped layers that do work
Some effects on a clipped layer are useful because they act on pixels inside the base shape.
- Gradient Overlay and Color Overlay on a clipped layer tint that layer within the base shape. They are drawn over the layer's own pixels, so they are not lost to clipping.
- Inner Shadow and Inner Glow on a clipped layer follow that layer's edges. If the layer is larger than the base, those edges lie outside the visible area and you will not see them.
- Bevel & Emboss on a clipped layer is clipped like everything else. Its highlights and shadows appear only where they fall inside the base shape.
The general rule: effects drawn inside a layer's own edges can survive clipping if those edges are inside the base shape. Effects drawn outside a layer's edges, such as Drop Shadow, Outer Glow, and the outside portion of a Stroke, will not.
Moving and scaling a clipping group
Clipped layers keep their own positions. If you move the base layer, the clipped photo stays where it is, and the shape slides over it. Different crops of the photo then show through. This is often what you want, but it can look like a bug.
To move both together, select the base and the clipped layers in the Layers panel, then use the Move tool. You can also link the layers with the link icon at the bottom of the Layers panel.
If you scale the group with Free Transform, scale the layer styles too. Use Layer > Layer Style > Scale Effects to resize effects after a transform. A Stroke that looked right at 20 px can look thin or heavy after the base is resized, because style values are set in pixels and do not scale automatically with the layer.
A short procedure for a clean setup
Follow this order when you build a clipped group with styles.
- Create the base layer, either a shape, a type layer, or a pixel layer. Confirm its shape and position.
- Place the content layer directly above it. Clip it with Alt-click (Windows) or Option-click (Mac) on the line between the layers.
- Add outer effects, such as Drop Shadow and Outer Glow, to the base layer.
- Check the base layer's blend mode. If it is not Normal, decide whether Blend Clipped Layers as Group should be on or off.
- Add inner effects to a duplicate of the base placed at the top of the group, with Fill at 0%.
- Convert the content layer to a Smart Object before scaling or filtering it, so you can change it later without loss.
Edge cases
- Type as a base layer. Type works as a base, and its styles follow the letter shapes. If you rasterize the type, the clipping remains, but you can no longer edit the text.
- Several layers clipped to one base. All of them are limited to the same shape. Layer styles on each one are still computed per layer. A Drop Shadow on a middle clipped layer can show on a clipped layer above it, because the layers above are still part of the group's content.
- Layer groups. If you put the base and its clipped layers in a layer group, the group's blend mode defaults to Pass Through. Changing it to Normal isolates the group. This can change how clipped blend modes look, in the same way that the Blend Clipped Layers as Group box does.
- Fill on a clipped layer. Lowering Fill on a clipped layer fades its pixels but not its own styles, such as a Color Overlay. The styles are still trimmed by the base shape.
- Style on a layer inside a Smart Object. Styles on layers inside a Smart Object are rendered inside it. Styles on the Smart Object layer itself act on the whole object. Choose where each style belongs.
Quick reference
| Goal | Put the style on | Notes |
|---|---|---|
| Outer shadow around a photo-in-shape | Base layer | Not clipped, because the base is the bottom of the group. |
| Inner edge shading over the photo | Duplicate of the base, on top, Fill 0% | Keeps the base free for outer effects. |
| Tint of a clipped photo | Clipped layer, as Color or Gradient Overlay | Trimmed to the base shape. |
| Clipped Multiply layer ignored | Base layer, turn off Blend Clipped Layers as Group | Applies when the base is not Normal. |
| Fade the fill but keep the stroke | Base layer, lower Fill | Opacity would fade the stroke too. |
Exercise
A photo is clipped to a rounded rectangle. You add a Drop Shadow to the photo layer, and no shadow appears. Where should the Drop Shadow go, and why?
Show answer
Put it on the base layer, the rounded rectangle. A Drop Shadow on the clipped photo is drawn outside the photo's edges, and clipping hides everything outside the base layer's opaque area, so it is cut away. A shadow on the base is drawn from the base's shape and is not clipped, because clipping only affects layers above the base.
Exercise
A base layer is set to Overlay, and the Multiply blend mode on a layer clipped to it seems to do nothing. What setting do you check, and which way do you change it?
Show answer
Open the base layer's Layer Style dialog, go to Blending Options, and look at Blend Clipped Layers as Group under Advanced Blending. It is on by default, which makes the base's blend mode govern the whole group. Turn it off so the clipped layer keeps its own Multiply mode inside the group.
Exercise
You want a shape with a Stroke to keep the stroke visible while the shape's own color fades out over a clipped photo. Which slider do you lower on the base layer, Opacity or Fill?
Show answer
Fill. Fill fades the layer's own pixels but leaves layer styles such as the Stroke at full strength. Opacity would fade the stroke and the clipped content as well.