Sub topic 4
Clipping mask or layer mask: choosing the right one
Clipping masks and layer masks both hide parts of a layer without erasing pixels. They get their hiding instructions from different places, so each one suits different jobs. This chapter gives you a working model of both and a decision process for choosing between them. It also covers the cases where combining them is the right answer.
This chapter assumes you can create and reorder layers, and that you know what the previous chapters covered: how to create and release a clipping mask, and how the base layer controls the layers clipped to it. It also assumes you know what Opacity and blend modes do.
Where each mask gets its instructions
The core difference is where the visibility information lives.
- A layer mask is a grayscale image attached to one layer. White areas show the layer, black areas hide it, and grays show it partially. You paint on the mask to change what is visible.
- A clipping mask has no image of its own. The layers above the base layer show only where the base layer has pixels, and they show less where the base is partly transparent. You change what is visible by changing the base layer.
A layer mask belongs to the layer it hides. A clipping mask is a relationship between layers: the base layer controls everything clipped to it.
How a layer mask behaves
You add a layer mask with the Add Layer Mask button at the bottom of the Layers panel. If a selection is active, the selection becomes the visible area and everything else is hidden.
Useful behaviors to know:
- Paint with black to hide, white to reveal, and gray to hide partially. Pressing D resets the foreground and background colors, and X swaps them.
- A gradient on a mask fades a layer out smoothly.
- Click the mask thumbnail to edit the mask. Click the layer thumbnail to edit the pixels. The thumbnail with the highlighted border is the one you are editing, and this is the most common source of confusion.
- Shift-click the mask thumbnail to disable the mask temporarily. A red X appears over it.
- Alt-click (Windows) or Option-click (Mac) the mask thumbnail to view the mask itself in the document window.
- The Properties panel has Density, which controls how strongly the mask hides, and Feather, which softens its edges. Both are non-destructive.
- The chain icon between the layer thumbnail and the mask thumbnail links them, so they move together. Unlink them to move the layer under a fixed mask.
A layer mask works at the pixel level, so it can hide any shape, including soft, irregular, or hand-painted edges. A related tool, the vector mask, defines its shape with a path instead of pixels. It keeps crisp edges at any scale, and you can add one to a layer once a layer mask already exists.
How a clipping mask behaves
You create a clipping mask by selecting the upper layer and choosing Layer > Create Clipping Mask, pressing Alt+Ctrl+G (Windows) or Option+Cmd+G (Mac), or Alt/Option-clicking the line between two layers. The clipped layer shows an indented thumbnail and a small arrow.
Three behaviors matter when you are deciding:
- The base is the lowest layer in the clipped group. Every layer clipped directly above it follows its shape.
- Several layers can share one base. A texture, a color fill, and an adjustment layer can all be clipped to the same shape layer.
- The base's transparency, not its color, is what counts. A base layer filled with black or white acts the same way, because only the presence of pixels matters.
Because the shape lives on a real layer, you can use tools that do not work on masks. You can transform the base layer, edit type, change a shape layer's path, or apply a warp. The clipped layers follow automatically. This is the main reason clipping masks are the natural choice for type and vector shapes.
Side-by-side comparison
| Question | Layer mask | Clipping mask |
|---|---|---|
| Where is the shape stored? | In a grayscale mask attached to the layer | In the transparency of the base layer |
| How many layers does it affect? | One layer (or one group, if applied to a group) | The base layer's clipped group of layers |
| How do you edit the shape? | Paint, fill, or apply filters to the mask | Edit the base layer's pixels, text, or shape |
| Can it make partial transparency? | Yes, with grays and gradients | Yes, if the base has partly transparent pixels |
| Does it change the layer's content? | No, the pixels stay | No, the pixels stay |
| Can you reverse it? | Disable, delete, or apply the mask | Release the clipping mask |
| Best for | Retouching, blending, fades, selections | Type, shapes, adjustment limits, texture fills |
A decision process
Work through these questions in order.
- Does the visible shape already exist as a layer? If it is a type layer, shape layer, or a cutout you want to reuse, use a clipping mask. You avoid recreating the shape on a mask.
- Will the shape change later? If you might retype the text, resize the shape, or reposition it, use a clipping mask. The clipped layers update with the base.
- Do you need to paint, fade, or erase parts by hand? Use a layer mask. Brush work and gradients are what masks do best.
- Is the hidden region based on a selection, such as a subject or a color range? Use a layer mask. Making a selection and clicking Add Layer Mask is the fastest route.
- Should several layers share the same limit? Use a clipping mask, or put the layers in a group and add one layer mask to the group.
- Do you need both a shape and hand-painted detail? Combine them, as described next.
Cases that point clearly one way
- A photo inside a text outline. Use a clipping mask. Put the photo above the text layer and clip it. If the client changes the wording, you only retype it.
- Removing a background from a portrait. Use a layer mask. You need soft hair edges, refinement, and a way to paint back mistakes.
- A color adjustment limited to one object. Use a clipping mask if the object is on its own layer. Use a layer mask on the adjustment layer if the object is part of a flattened photo and you have a selection.
- A fade at the edge of a texture. Use a layer mask with a gradient. A clipping mask cannot paint a gradient on a layer by itself.
Combining both
The two features do not conflict. You can use both at once, and they work at different levels of the stack.
A layer mask on the base layer changes the shape for every clipped layer. If you mask part of the base, the clipped layers disappear there too. This lets you carve a hand-painted edge into a shape and still have the clipped content follow it.
A layer mask on a clipped layer affects only that layer. The base layer and the other clipped layers keep their behavior. Use this to fade a single texture inside a shape without touching the shape.
A layer mask on a group works when you need a mask to cover several layers that are not clipped to each other. Select the layers, press Ctrl+G or Cmd+G to group them, and add a mask to the group.
Applying versus keeping masks
The context menu on a layer mask offers Apply Layer Mask, which permanently deletes the hidden pixels. This is destructive. Keep the mask unless file size or a handoff requirement forces you to apply it. If you do need to apply it, duplicate the layer first. Releasing a clipping mask never deletes pixels, which makes it the safer of the two to experiment with.
Common mistakes
- Painting on the wrong thumbnail. If your brush strokes change the photo instead of the mask, the layer thumbnail was selected. Click the mask thumbnail first.
- Expecting the clipped layer to move the shape. Moving a clipped layer moves its content within the base's shape. It does not move the shape. To reposition the shape, move the base layer.
- Reordering layers and breaking the clip. Dragging a layer to a different place in the stack can release it from the clipping group, or pull an unrelated layer into the group. Check the indent arrows after you reorder.
- Using a layer mask when you need to reuse the shape. Copying a hand-painted mask to a second layer is possible with Alt/Option-drag, but the copies then drift apart. A base layer shared through clipping stays consistent.
- Forgetting that the base's Opacity affects the clipped group. Lowering the base layer's Opacity fades the clipped layers, too. The next chapters explain this in more detail when covering layer styles and the Blend Clipped Layers as Group option.
Practice
Exercise
You have a photograph on its own layer and a type layer reading "SUMMER". The client says the word may change to "AUTUMN" tomorrow. Which kind of mask would you use to show the photo only inside the letters, and why?
Show answer
Use a clipping mask. Place the photo layer directly above the type layer and clip it. The type layer is the base, so retyping the word changes the shape automatically and the photo follows. With a layer mask you would have to rebuild the letter shapes on the mask after every change.
Exercise
A portrait photo has a busy background. You want to hide the background but keep the subject's wispy hair edges, and you need to be able to fix mistakes later. Which mask do you choose, and how do you correct an area you hid by mistake?
Show answer
Use a layer mask. Make a selection of the subject, refine the edges, and click Add Layer Mask. To fix an area you hid by mistake, click the mask thumbnail, set the foreground color to white, and paint over the area to reveal it again. The original pixels were never deleted, so nothing is lost.
Exercise
A shape layer has three layers clipped to it. You add a layer mask to the shape layer and paint black over its left half. What happens to the three clipped layers? Then you add a layer mask to only the top clipped layer and paint black over its right half. What is visible now?
Show answer
After the first mask, all three clipped layers are hidden on the left half, because the base layer's mask changes the base's visible shape and every clipped layer follows it. After the second mask, the top clipped layer is also hidden on the right half. The right half still shows the two lower clipped layers, and the left half shows nothing from any of the three.