How to use layer masks
By Pixuvia · · Updated

Layer masks hide parts of a layer without erasing them. Each mask is a grayscale image attached to one layer: white shows the layer, black hides it, and gray makes it partly see-through. Paint the mask and the layer changes on screen, while its pixels stay intact underneath.
This layer mask tutorial uses the Pixuvia online photo editor, which follows Photoshop's menu names, so the same steps carry over to Photoshop. You will add a mask, paint it, blend two photos with a gradient, and learn which mask commands to reach for. New to layers? Start with layers explained, then come back here.
On this page
- What is a layer mask?
- Why use a mask instead of the Eraser?
- How to add and paint a layer mask
- How to paint on a layer mask
- Example: blend two photos with a layer mask
- How to make a layer mask from a selection
- Layer mask commands and shortcuts
- Layer mask vs vector mask vs clipping mask
- Layer masks on adjustment layers
- Do layer masks survive in PSD files?
- Questions
- Sources
What is a layer mask?
A layer mask is a black-and-white map of where a layer is visible. White areas of the mask show the layer, black areas hide it, and every shade of gray in between hides it partly: 50% gray leaves the layer about half transparent. The layer underneath shows through wherever the mask is dark.
Why use a mask instead of the Eraser?
The Eraser deletes pixels. Once you save and close, or run out of undo steps, those pixels are gone. A mask only hides them, so you can paint white to bring back any area a day later.
That makes masks the safer choice for cutouts, composites and local edits. You can also turn a mask off to compare before and after, or delete it to get the whole layer back. Photoshop users call this non-destructive editing.
How to add and paint a layer mask
- Open your photo in the Editor and click the layer you want to mask in the Layers panel. The Background layer cannot take a mask, so click its lock first to turn it into a normal layer.
- Click Add Layer Mask at the bottom of the Layers panel, or choose Layer > Layer Mask > Reveal All. A white mask thumbnail appears next to the layer thumbnail with a frame around it, which means your tools now paint the mask.
- Press D for the default colors: black foreground, white background.
- Press B for the Brush tool. Click the brush tip button (or right-click the canvas) to set the Size, and lower the Hardness for a soft edge.
- Paint black over the parts you want to hide. Press X to swap to white and paint back anything you hid by mistake.
- Lower the brush Opacity to paint gray, which hides an area only partly.
- Click the layer thumbnail to go back to editing the layer's own pixels, or press Ctrl+\ (Cmd+\ on a Mac) to switch between the mask and the pixels.

If you had a selection when you clicked Add Layer Mask, the new mask reveals only the selection and hides the rest. Without one, the mask starts white and shows the whole layer, which is the same as Layer > Layer Mask > Reveal All.
How to paint on a layer mask
Painting a mask comes down to three choices: color, edge and strength. Black hides and white reveals. A low Hardness gives a soft, gradual edge that blends naturally, while 100% Hardness gives a crisp one. Brush Opacity sets how strongly each stroke hides or reveals.
- Resize the brush as you go with [ and ], large for broad areas and small for edges.
- Check the mask itself with \, which shows it over the canvas. Holes and stray marks are easy to spot there. Press \ again to go back to the image.
- Compare before and after by Shift-clicking the mask thumbnail, which turns the mask off and on.
- Any color works. The mask only stores gray, so a colored brush paints the gray of that color. Pressing D first keeps it to pure black and white.
Example: blend two photos with a layer mask
A gradient on a mask fades one photo smoothly into another, such as a sky into a landscape or two portraits side by side. Here is the full workflow.
- Open the first photo. Then choose File > Place Image… and pick the second photo. It comes in as a new layer on top, scaled down to fit and centered.
- Press V for the Move tool and drag the top photo so the two overlap where you want the blend.
- With the top layer selected, click Add Layer Mask in the Layers panel.
- Press D for black and white, then G for the fill tools. Shift+G switches between Paint Bucket and Gradient; pick Gradient. Its default is a linear Foreground to Background gradient.
- Drag across the overlap. Where you start, the mask turns black and the top photo disappears; where you stop, it turns white and the top photo shows fully.
- A short drag gives a hard transition, a long drag a gentle one. Not right? Undo with Ctrl+Z (Cmd+Z on a Mac) and drag again.
- Touch up with a soft black or white brush where something from one photo pokes through, such as a tree or a face.
How to make a layer mask from a selection
For a cutout, start from a selection instead of painting by hand. Choose Select > Subject, which finds the most prominent object in the image, or use the Lasso, Quick Selection or Object Selection tools. Then click Add Layer Mask: the subject stays and the background is hidden. The bar that appears next to a selection on the canvas offers Add Layer Mask too.
Hair and fur need a softer edge. Choose Select > Select and Mask… (Ctrl+Alt+R, Cmd+Option+R on a Mac), adjust Radius, Smooth, Feather and Shift Edge, and set Output To to Layer Mask. For a one-step cutout, Layer > Layer Mask > Remove Background builds a mask that reveals the layer's subject. The guide to removing a background in the Editor covers cutouts in more depth.
Layer mask commands and shortcuts
Every layer mask command lives under Layer > Layer Mask. Right-click a mask thumbnail in the Layers panel for the same list. Shortcuts use Ctrl on Windows and Linux and Cmd on a Mac.

| Command | Shortcut | What it does |
|---|---|---|
| Reveal All | Add Layer Mask button | Adds a white mask that shows the whole layer. |
| Hide All | None | Adds a black mask that hides the whole layer, ready to paint parts back in with white. |
| Reveal Selection | Add Layer Mask button with a selection | Shows the selected area and hides the rest. |
| Hide Selection | None | Hides the selected area and shows the rest. |
| Edit Mask / Edit Layer Pixels | Ctrl+\ | Switches what your tools paint: the mask or the layer. |
| View Mask | \ or Alt-click the thumbnail | Shows the mask over the canvas so you can check it. |
| Disable / Enable Mask | Shift-click the thumbnail | Turns the mask off and on without losing it. |
| Invert Mask | Ctrl+I | Swaps what is shown and hidden. Works when the mask is targeted. |
| Link / Unlink Mask | None | Linked, the mask moves with the layer. Unlinked, it stays in place while you move the layer. |
| Apply Mask | None | Removes the hidden pixels for good and drops the mask. Text and shape layers are turned into pixels first, after you confirm. |
| Delete Mask | None | Removes the mask and shows the whole layer again. |
Layer mask vs vector mask vs clipping mask
All three hide parts of a layer, but they get their shape from different places. A layer mask is painted pixels, a vector mask is a path, and a clipping mask borrows the shape of the layer below.
| Mask type | Shape comes from | Best for | How to add it |
|---|---|---|---|
| Layer mask | Gray pixels you paint | Soft edges, hair, blends and gradual fades | Add Layer Mask button or Layer > Layer Mask |
| Vector mask | A path drawn with the Pen tool | Crisp, sharp edges that stay sharp at any size | Layer > Vector Mask, or click Add Layer Mask again on a layer that already has a layer mask |
| Clipping mask | The pixels of the layer below | Putting a photo or texture inside text or a shape | Layer > Create Clipping Mask (Ctrl+Alt+G) |
A layer can have a layer mask and a vector mask at the same time. Vector masks don't go on shape layers (their path already is the mask), adjustment layers or the Background.
Layer masks on adjustment layers
Every adjustment layer comes with its own mask, so an edit like Curves or Hue/Saturation can apply to one part of the photo only. Add one with Layer > New Adjustment Layer or the New Adjustment Layer button in the Layers panel. The mask starts white, or reveals your selection if you had one.
An adjustment layer has no pixels of its own, so your brush always paints its mask. Paint black where the adjustment should not apply, for example to brighten a face but keep the background as it was. Apply Mask isn't offered on adjustment layers, since there are no pixels to cut.
Do layer masks survive in PSD files?
Yes. When the Editor opens a PSD, layer masks come in on their layers, including whether each one is on or off, and adjustment layers keep their masks. Saving with File > Export As > PSD writes them back the same way, so a file can go between Pixuvia, Photoshop and other PSD editors with its masks still editable.
One limit to know: masks on groups are not kept. Masks on the layers inside a group are. Exporting to PNG or JPG flattens the image, so the masks are applied to the result and can't be edited later; keep a PSD copy if you may want to change them. See the online PSD editor page for what else a PSD keeps, or convert a PSD to PNG once you're done.
Questions
What does a layer mask do?
A layer mask controls which parts of a layer are visible. White areas of the mask show the layer, black areas hide it and gray areas make it partly transparent. The layer's pixels are never deleted, so you can change the mask at any time.
Why is my brush painting on the photo instead of the mask?
The layer thumbnail is targeted instead of the mask thumbnail. Click the mask thumbnail in the Layers panel (it gets a frame) or press Ctrl+\ (Cmd+\ on a Mac), then paint again.
How do I invert a layer mask?
With the mask targeted, press Ctrl+I (Cmd+I on a Mac) or choose Layer > Layer Mask > Invert Mask. Everything the mask showed is now hidden and the other way round.
Can I use layer masks without Photoshop?
Yes. The Pixuvia Editor runs in the browser and has layer masks with the same Photoshop names: Reveal All, Hide All, Invert Mask, Apply Mask and the rest. It also opens and saves PSD files with their layer masks.
What is the difference between Delete Mask and Apply Mask?
Delete Mask removes the mask and shows the whole layer again. Apply Mask removes the hidden pixels for good and keeps only what the mask showed, so the layer no longer needs a mask.