Skip to content
Tutorials Center
My learning

Topics

Lesson 25 of 37 ยท Masks and Compositing

Clipping Masks, Vector Masks and Blend If

Learn how clipping masks restrict a layer to the shape below, how vector masks stay sharp at any size, and how Blend If hides pixels by brightness.

A layer mask hides pixels using a grayscale image. Photoshop has three more ways to limit what shows: clipping masks (use the layer below as the shape), vector masks (use a crisp path) and Blend If (use brightness values). Each solves a different problem.

Clipping masks

A clipping mask makes a layer visible only where the layer beneath it has pixels. The bottom layer is the base, and the layers above it are clipped to its shape and opacity.

To create one:

  • Select the upper layer and choose Layer > Create Clipping Mask, or press Ctrl+Alt+G (Cmd+Option+G).
  • Or hold Alt (Option) and click the line between the two layers in the Layers panel; the cursor changes to a small square with an arrow.

The clipped layer is indented with a small arrow. To release, repeat the shortcut.

Typical uses:

  • A photo inside text: put the photo above a type layer and clip it. The photo shows only through the letters.
  • A texture inside a shape: clip a paper texture to a rounded rectangle.
  • A local adjustment: clip a Curves adjustment layer to one layer, so it affects only that layer and not everything below.

The clipping stack takes its opacity and blend mode from the base layer. Lowering the base layer's opacity fades all clipped layers with it. You can also stack several layers on one base: they all clip together.

Python Stand-in: a clipped layer inherits the base transparency

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The photo only appears where the base is opaque, and half visible where the base is half transparent: the edge anti-aliasing of the base carries over.

Vector masks

A vector mask uses a path instead of pixels. Because it is resolution-independent, its edges stay perfectly sharp even when you scale the layer up. It is ideal for logos, buttons and product shots with geometric edges.

Create one:

  1. Draw a path with the Pen tool or a shape tool in Path mode.
  2. With the layer selected, choose Layer > Vector Mask > Current Path, or Ctrl+click the Add Layer Mask button while a path is active.
  3. Edit the mask with the Direct Selection tool: click the vector mask thumbnail, then move anchor points.

Both mask types can exist on one layer: the vector mask thumbnail sits next to the pixel mask thumbnail. If you want to paint on a vector mask, convert it with Layer > Rasterize > Vector Mask. A pixel mask is the better choice for soft or organic edges such as hair, fog or fur.

The core of a vector mask is deciding which side of a path is "inside". Photoshop uses the non-zero winding rule for combined paths, but for a simple closed polygon you can test with ray casting:

Python Stand-in: is a point inside a polygon path?

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

A pixel mask would store a value for every pixel of the canvas; a vector mask stores only the corner points, so it is tiny and exact.

Layer Style Blend If

Blend If (in Layer Style > Blending Options, at the bottom) hides pixels based on their brightness or color channel. Two sliders each exist: This Layer (the layer you are on) and Underlying Layer (everything below).

  • Drag the white slider on This Layer to the left to hide the brightest pixels of the layer. Good for removing a white background or sky from a texture.
  • Drag the black slider to the right to hide the darkest pixels (remove black from fire, smoke or lens flares).
  • Alt+drag a slider to split it into two halves. The gap between the halves creates a smooth transition rather than a hard cut.
  • Underlying Layer sliders keep the layer visible only where the layer below is in a certain tonal range, e.g. add a texture only on the shadows.

The result is not a mask you can paint on, but it is quick and entirely non-destructive. If you need a mask from it, convert the layer to a Smart Object first so that the Blend If stays editable and you can add a mask on top.

Python Stand-in: Blend If dropping bright pixels

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The split version fades the bright pixels gradually, which avoids rough edges (this is what Alt+drag does).

Knockouts and Fill Opacity

In Blending Options > Advanced Blending, Knockout: Shallow / Deep makes a layer cut a hole through the layers below it. It is usually paired with lowering the Fill Opacity to 0 so only the layer style shows. Knockouts are used for cut-out text, frames and transparency effects. The behavior depends on group structure and where the knockout layer sits, so test on a small document first.

Which mask should I use?

Need Best tool
Fine, soft or painted edges Layer mask
One layer shaped by another Clipping mask
Sharp geometric edges, scalable Vector mask
Hide by tone automatically Blend If

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is the keyboard shortcut to create a clipping mask?

    Ctrl+Alt+G (Cmd+Option+G on Mac) clips the selected layer to the one below. Alt+click between layers does the same.
  2. 2. Where does a clipped layer get its shape from?

    A clipped layer shows only where the base layer below has pixels, and it follows the base layer's opacity.
  3. 3. Why choose a vector mask over a pixel mask?

    A vector mask is a path, so it is resolution independent. Pixel masks are better for soft, painted edges.
  4. 4. What does Alt+dragging a Blend If slider do?

    Splitting the slider defines a range in which pixels fade out gradually, avoiding a harsh edge.

Summary

  • A clipping mask limits layers to the shape and opacity of the base layer below.
  • Vector masks use paths for crisp, scalable edges; pixel masks handle soft edges.
  • Blend If hides pixels by brightness and can be split for smooth transitions.
  • Knockouts cut through layers, usually with Fill Opacity at 0.

Next: Blend Modes and Opacity