Skip to content

What Is a Layer Mask? Layers and Masks Explained, With an Example

A layer mask hides parts of a layer without erasing them: where the mask is white the layer shows, where it is black the layer disappears, and gray makes it partly see-through. Because the pixels are only hidden, you can bring them back at any time, which is what makes masks the heart of non-destructive editing. This guide answers what layer masking is and how to add a mask in four steps, then explains layers, blend modes and adjustment layers and walks through blending two photos with a soft mask.

Three panels: a black-and-white copy of a flower photo (the top layer), its layer mask, a gradient from black on the left to white on the right, and the result, where the flowers are in full color on the left and fade to black and white on the right.

What is a layer mask?

Layer masking means controlling how visible a layer is with a second, black-and-white picture instead of deleting pixels. Each layer can carry one mask, shown as a second thumbnail beside the layer in the Layers panel. The mask has no color of its own; only its brightness counts:

  • White reveals. Where the mask is white, the layer shows at full strength.
  • Black hides. Where the mask is black, the layer is invisible and whatever lies below it shows through.
  • Gray partly reveals. A 50% gray shows the layer at about half strength, which is how soft edges and smooth fades are made.

Why masking is non-destructive

The Eraser removes pixels for good: once the history is gone, so are they. A mask leaves every pixel of the layer intact and only changes how much of it you see. Hide too much and you paint white to bring it back; change your mind about the whole idea and you disable or delete the mask. That freedom is why designers mask instead of erasing, and why a masked edit can still be adjusted after you save and reopen the project.

Add a layer mask in four steps

  1. Select the layer. In the editor, click the layer you want to hide parts of in the Layers panel so its row is highlighted.
  2. Add the mask. Click Add layer mask at the bottom of the Layers panel, or choose Layer › Layer Mask › Reveal All. The new mask is white, so nothing changes yet. Layer › Layer Mask › Hide All starts from a black mask instead and hides the whole layer.
  3. Target the mask. Click the mask thumbnail so it is highlighted; brush strokes now go into the mask rather than onto the photo. Press D to set the colors to black and white.
  4. Paint black to hide, white to restore. Choose the Brush (B) and paint black over what should disappear. Press X to swap to white and paint back anything you hid by mistake. A soft brush (low Hardness) gives a gradual transition instead of a hard cut.

What a layer is, and why stacking order matters

Think of a layer as a sheet of clear film with an image on it. The document is a stack of these sheets, and what you see is the stack viewed from above. Where a layer has pixels, it covers what is below; where it is transparent (the checkerboard), lower layers show through.

The Layers panel lists the stack with the top layer first. Drag a layer up or down to change what covers what. A text layer placed below a photo disappears, not because it is gone but because the photo is on top of it. The eye icon hides a layer without deleting it, which is the quickest way to compare “with” and “without”.

Separate layers keep edits reversible: a logo, a caption and a photo on three layers can each be moved or deleted later. Most edits, such as painting and filters, change only the active layer (the highlighted row), so many “it did nothing” moments come down to the wrong layer being selected.

The Photoyam Pro editor with a layered document open: the Layers panel lists a “Lighthouse Point” text layer at the top, a group holding a Curves adjustment layer and a “Sun glow” paint layer, and the lighthouse photo as a smart object at the bottom; the canvas shows the title over the sky.
A layered document in the Pro editor. The Layers panel lists the stack top first, and small icons mark what each row is: text, an adjustment, a group or a smart object.

Opacity, Fill and blend modes

Opacity fades the whole layer. At 50%, each pixel shows half its own color and half of whatever is below. Fill, just below it in the panel, fades the layer’s own pixels but not its layer effects. Set a text layer with a stroke to Fill 0% and you get hollow outlined lettering; set it to Opacity 0% and the stroke disappears too.

A blend mode changes the math used to combine a layer with the layers below. Instead of simply covering them, each pixel is mixed by a formula. Three are worth learning first:

Three blend modes to learn first
ModeWhat it doesTypical use
MultiplyMultiplies colors, so the result can only get darker. White becomes invisible.Painting shadows on a new layer; placing a scanned signature or line drawing so the white paper vanishes.
ScreenThe inverse of Multiply: the result can only get lighter. Black becomes invisible.Adding light: glows, sparks, fire or light leaks shot on a black background.
Overlay / Soft LightDarkens darks and lightens lights. 50% gray has no effect.Adding contrast, or a texture layer that should follow the image’s tones. Soft Light is the gentler of the two.

A quick shadow trick: add a new layer, set it to Multiply, paint with a soft brush in a dark, slightly warm color, and lower the layer’s Opacity until the shadow sits naturally.

Mask controls in Photoyam

With the basics from the first section in place, these are the controls you will use once a layer has a mask, including the ones that start a mask from a selection:

  • Add a mask: click Add layer mask at the bottom of the Layers panel. With no selection, the mask starts all white (everything visible). With an active selection, the selected area becomes white and the rest black, and soft selection edges become gray.
  • Paint the mask: click the mask thumbnail (the second thumbnail on the layer row) so it is highlighted. The Brush now paints the mask with the foreground color, and the Eraser paints it with the background color.
  • Turn it off for a moment: Shift+click the mask thumbnail to disable or re-enable it, handy for a before/after check.
  • Turn it into a selection: Ctrl+click (Cmd+click on a Mac) the mask thumbnail to load it as a selection.
  • Refine it globally: in the Properties panel, Feather (up to 250 px) softens the whole mask edge and Density weakens the black areas so hidden parts show through slightly. Invert swaps black and white; Apply bakes the mask into the pixels.

Adjustment layers: color changes you can undo later

An adjustment layer stores a correction, such as Curves, Levels, Hue/Saturation or Black & White, instead of pixels. It affects every layer below it and can be changed or deleted at any time. Add one with Layer › New Adjustment Layer (for example Layer › New Adjustment Layer › Curves), or click the half-circle New adjustment layer button at the bottom of the Layers panel and pick the type from its list. The new layer is selected and its controls appear right in the Properties panel, so there is no dialog to confirm: every change shows live.

Do not confuse this with Image › Adjustments. The commands in that menu, such as Image › Adjustments › Curves… (Ctrl+M), open a dialog with Preview, Cancel and OK and change the active layer’s pixels directly when you click OK. That is fine for a quick, final fix, but it cannot be tweaked later except with Undo. When you want to keep the option of changing your mind, use an adjustment layer.

Adjustment layers can have masks too: select one and click Add layer mask, so you can brighten only a face or desaturate only the background. To make an adjustment affect only the single layer directly beneath it, use Layer › Create Clipping Mask (Ctrl+Alt+G), or click the Clipping mask button at the bottom of the Layers panel. A clipped layer is indented in the panel and shows only where the layer below it has pixels. On a clipped layer the same menu item reads Release Clipping Mask and undoes the clip.

Hands-on: blend two photos with a mask

This example fades one photo into another, such as a portrait blending into a landscape. It uses every idea above: stacking, masks and an adjustment layer.

  1. Open the base photo. In the editor, use File › Open… and pick the photo that should fill the frame, for example a landscape.
  2. Place the second photo. Choose File › Place… and pick the portrait. It lands centered on a new layer above the base, as a smart object, so you can scale it with Edit › Free Transform (Ctrl+Alt+T) without losing quality. (In Photoshop the shortcut has no Alt, but in a browser that combination opens a new tab, so the Pro editor adds Alt.)
  3. Select the part to keep. With the top layer active, press M for the Rectangular Marquee and drag over the side of the portrait you want to keep, about two-thirds of the width.
  4. Add the mask. Click Add layer mask at the bottom of the Layers panel (or choose Layer › Layer Mask › Reveal Selection). The selected area stays visible and the rest is hidden. The seam is still a hard vertical line.
  5. Soften the transition. In the Properties panel, drag the mask’s Feather up. On a photo around 2,000 px wide, somewhere between 80 and 200 px gives a gentle fade. Because Feather is a setting, not a paint stroke, you can change it any time.
  6. Paint the details. Click the mask thumbnail, choose the Brush (B), lower Hardness to 0% and Opacity to about 30%, and paint with black where the landscape should show through more, or white where the portrait should return. Low opacity builds up gradually, so several light strokes look more natural than one strong one.
  7. Match the colors. With the portrait layer active, add a Hue/Saturation or Curves adjustment layer with Layer › New Adjustment Layer (not Image › Adjustments, which would change the portrait’s pixels permanently). Then choose Layer › Create Clipping Mask (Ctrl+Alt+G) so it changes only the portrait, and nudge its settings in the Properties panel until both photos share a similar warmth and brightness.
  8. Check and save. Shift+click the mask to compare with and without it. Save with File › Save As Project (.psy) to keep everything editable, and use File › Export As for a JPG or PNG to share.
Two layers in the Photoyam Pro editor: a black-and-white copy of a flower photo above the color original, with a black-to-white gradient on its layer mask, so the flowers are in color on the left and gray on the right. The mask thumbnail sits next to the layer thumbnail in the Layers panel, and the Properties panel shows the Masks section with Density, Feather, Invert, Load as selection and Apply.
The top layer fades into the one below through a gradient on its mask. The second thumbnail on the layer row is the mask: click it to paint on the mask, Shift+click it to switch the mask off for a quick before/after.

Troubleshooting

The brush is painting color onto my photo

The layer’s pixels are the target, not its mask. Undo (Ctrl+Z), click the mask thumbnail so it is highlighted, and paint again. A mask only understands gray values, so if you picked a color, it is used as its brightness.

The mask edge has a visible halo

The edge is too soft for the subject. Lower the mask Feather, then paint the edge with a smaller, harder brush.

Nothing changes when I paint black

Check that the mask is enabled (a disabled mask thumbnail is dimmed and crossed by a red line; Shift+click it to switch it back on), that the layer is visible and above 0% opacity, and that you are on the right layer. If the layer has a Density below 100% in the Properties panel, black on the mask only hides part of the layer.

The brush says it “could not use” the tool

Paint and retouch tools explain why they refused instead of doing nothing: the layer is locked, the target layer is hidden, or it has no pixels to edit. Unlock or show the layer, or pick a different one in the Layers panel. A text layer, shape or smart object needs to become pixels first, and the notice has a Rasterize button that does it in one click. An adjustment layer has no pixels of its own; add a layer mask to it and paint on the mask instead.

Common mistakes

  • Using the Eraser instead of a mask. It works until you need the pixels back. Masks cost nothing and keep every option open.
  • Hard brushes on masks. A 100% hardness brush leaves a visible line. Start soft and low-opacity, and harden only for crisp objects.
  • Forgetting to clip adjustments. An unclipped Curves layer changes every layer below it, not just the one you meant.
  • Merging too early. Merge Down and Flatten Image throw away the separation that makes later fixes easy. Keep a layered .psy first.

Try it in Photoyam

Layers, blend modes, masks and adjustment layers in a free editor that runs in your browser.

FAQ

What is the difference between a layer mask and the Eraser?

The Eraser deletes pixels, so getting them back means undoing. A mask only hides them: paint white on the mask later and the original pixels return, even after you have saved and reopened a project.

My brush paints on the photo instead of the mask. Why?

The layer's image, not its mask, is the paint target. Click the mask thumbnail in the Layers panel so it is highlighted, then paint. Clicking the layer's image thumbnail switches back to painting pixels.

Can I use the Gradient tool on a mask?

Yes. Click the mask thumbnail so the mask is the paint target, choose the Gradient tool (it shares a toolbar slot with the Paint Bucket, shortcut G) and drag across the image. The gradient is painted into the mask as shades of gray, so the black end hides the layer, the white end shows it, and everything in between fades. Drag again to replace it, or press X to swap the colors and reverse the fade.

Do masks survive if I save as PSD?

Yes. Raster layer masks are written to the PSD as editable masks, including whether they are disabled, and vector masks stay vector masks unless the path is open or the layer is warped. A Photoyam project (.psy) keeps them too, along with mask Feather and Density settings.

What is layer masking used for?

Layer masking is used whenever part of a layer should disappear without being deleted: blending two photos, cutting a subject out of its background, limiting an adjustment layer to one area such as a face, or fading text or a texture into a picture. Because the mask is separate from the pixels, each of these can still be refined later.

What is the difference between a layer mask and a clipping mask?

A layer mask uses its own grayscale pixels to decide which parts of one layer show. A clipping mask uses the layer below instead: the clipped layer only appears where that lower layer has pixels. Create one with Layer › Create Clipping Mask (Ctrl+Alt+G).

What is the black-and-white map that shows and hides a layer called?

It is the layer mask: a grayscale picture attached to one layer. White reveals the layer, gray makes those pixels partly transparent, and black hides them. Painting black on the mask with the Brush hides that part of the layer without deleting any pixel data, which is why painting white over it later brings the original back.