Sub topic 1
Why mask instead of erase
Every edit in Photoshop either changes pixels permanently or stores the change as an instruction that can be reversed. This chapter explains that difference and shows why a layer mask is the better tool when you want to hide part of a layer. The later chapters in this tutorial cover how to build and manage masks. This one covers the reason to use them.
Prerequisites
This chapter assumes you can already do the following:
- Find your way around the Layers panel, the Tools panel and the Properties panel.
- Work with layers: create, rename, reorder, and change opacity.
- Use the Brush tool and change its size, hardness and color.
- Make a basic selection with the Marquee, Lasso or Quick Selection tool.
You do not need any prior knowledge of masks. You will make your first one in the next chapters. Here you only need to see why one is worth making.
Destructive and non-destructive editing
A destructive edit changes the pixel data of a layer. Once the file is saved and the History panel is cleared (or the document is closed), the original pixels are gone. A non-destructive edit leaves the original pixels untouched. It stores the change as a separate setting, layer or mask, so you can change it later or remove it completely.
Common destructive actions include:
- Using the Eraser tool on a layer.
- Pressing Delete on a selection inside a layer.
- Cropping with "Delete Cropped Pixels" turned on.
- Painting directly on a photo layer.
- Applying a filter to a normal pixel layer.
- Rasterizing a smart object or text layer.
Common non-destructive alternatives include:
- Layer masks, which hide pixels without deleting them.
- Adjustment layers, which apply tone and color changes as a separate layer.
- Smart objects and smart filters, which keep the source data and the filter settings.
- Cropping with "Delete Cropped Pixels" turned off.
- Painting on a new empty layer instead of on the photo.
| Task | Destructive way | Non-destructive way |
|---|---|---|
| Remove a background | Eraser tool or Delete key | Layer mask |
| Darken one area | Burn tool on the photo | Adjustment layer with a mask |
| Sharpen a photo | Filter on a pixel layer | Smart filter on a smart object |
| Blend two photos | Erase the edge of the top photo | Gradient on a layer mask |
What happens when you erase
Suppose you have a portrait on one layer and you want to remove the background. You select the background and press Delete. Photoshop turns those pixels transparent. The color information is removed from the layer.
Now suppose you later find that you cut too close to the hair. You cannot get the missing pixels back by editing the layer. Your options are to step back through the History panel (which only works within the current session and is limited by the number of history states), to reopen an earlier saved version, or to rebuild the lost area by hand.
Erasing has three practical costs:
- Mistakes are permanent. An over-erased edge stays over-erased.
- You cannot change your mind. If a client wants the background back, you start over.
- The layer cannot be reused. A cut-out layer cannot be placed into a different composition that needs the area you removed.
What happens when you mask
A layer mask is a grayscale image attached to a layer. It does not change the layer's pixels. It controls how visible each pixel is. Where the mask is white, the layer shows. Where the mask is black, the layer is hidden. The next chapter explains this rule in detail.
When you hide the background with a mask, the background pixels are still in the file. They are only not displayed. If you cut too close to the hair, you pick the Brush tool, paint with white on the mask, and the hair returns. Nothing is lost, and the fix takes seconds.
The following diagram shows the same task done both ways.
A worked comparison
Follow these steps once to see the difference for yourself. You need any photo with a subject you can select.
- Open a photo in Photoshop. In the Layers panel, double-click the Background layer to turn it into a normal layer, then click OK. Duplicate it twice with Ctrl+J (Windows) or Cmd+J (macOS).
- Name the top two layers "Erased" and "Masked". Hide the lowest layer by clicking its eye icon.
- Select the "Erased" layer. Use the Quick Selection tool to select the subject, choose Select > Inverse, and press Delete. The background becomes a checkerboard, which is how Photoshop shows transparency.
- Hide the "Erased" layer and select the "Masked" layer.
- Use the Quick Selection tool to select the subject again. With the selection active, click the Add Layer Mask button at the bottom of the Layers panel. It looks like a rectangle with a circle inside it.
- The background is now hidden on this layer too. Both layers look the same on screen.
Now test them. On each layer, try to bring back a strip of background near the subject's edge:
- On "Erased", you cannot. Only the History panel can help, and only if you have not moved on too far.
- On "Masked", click the mask thumbnail so it has a frame around it. Press D to reset the default colors, then press X until white is the foreground color. Paint with the Brush tool along the edge. The background reappears wherever you paint.
You can also see the stored pixels another way. Hold Alt (Windows) or Option (macOS) and click the mask thumbnail. This shows the mask itself as a black and white image. Click the layer thumbnail to return to the normal view.
Where masking helps in daily work
Masks are not only for removing backgrounds. They are useful whenever you want an effect to apply to part of an image.
- Compositing. Combine two or more photos and blend the joins with soft edges.
- Local adjustments. Brighten a face without brightening the whole photo, by masking an adjustment layer.
- Selective effects. Keep a subject sharp while a blur applies only to the background.
- Revisions. Let a client choose between versions by changing what the mask hides.
- Text and shape effects. Fade the edge of a layer so it blends into what lies below.
What masking does not do
Masking is not free of trade-offs, so it helps to know the limits.
- File size. Hidden pixels stay in the file. A large photo that is mostly masked out still stores all of its data. This can make PSD files bigger than they need to be.
- Sharing. If you export a layered file or send it to someone, the hidden content goes with it. Remove sensitive areas for real before you share a layered file, or flatten a copy.
- Not every task needs it. On a throwaway image, or when you are certain you will not revisit the edit, erasing is faster and has no downside.
- Mask quality matters. A mask cannot add detail that is missing from the original pixels. A rough mask around fine hair still looks rough. Later chapters cover Select and Mask for this.
A quick rule of thumb
Use this decision guide when you are about to remove or hide something.
| Situation | Choice |
|---|---|
| You might change your mind | Mask |
| The layer will be reused elsewhere | Mask |
| You are working for a client or on a long project | Mask |
| The layer is a throwaway test | Either one is fine |
| You need to shrink file size and are sure of the result | Erase, on a saved copy |
When you do erase, work on a duplicate layer or a copy of the file. That keeps an escape route open even for permanent edits.
Common mistakes at this stage
- Painting on the wrong thumbnail. The frame shows which one is active. Check before you paint.
- Flattening too early. Merging layers or flattening the image applies the masks permanently. Delay it until the very end, and do it on a copy.
- Confusing hidden with deleted. A hidden pixel is still there. If you apply a mask or export, it may be removed or flattened. Later chapters cover Apply Layer Mask and what it does.
- Working on the Background layer. The Background layer cannot hold a mask or transparency. Convert it to a normal layer first, as you did in the worked comparison.
Exercise
You erased the sky from a photo layer with the Eraser tool, saved the PSD, and closed it. A client now asks for the original sky back. Why can you not recover it from this file, and what should you have done instead?
Show answer
The Eraser deleted the sky pixels from the layer, and closing the document cleared the History panel, so nothing in the file stores them. You should have added a layer mask and painted black (or used a selection) to hide the sky. The sky pixels would then remain in the layer, and painting white on the mask would bring the sky back. Working on a duplicate layer would have been a second safe option.
Exercise
Name two reasons why a mask can still be the wrong choice for a finished image that you will send to a third party as a layered file.
Show answer
First, hidden pixels remain in the file, so the recipient can reveal them, which matters if the hidden content is private. Second, hidden pixels add to the file size, so the file can be much larger than needed. In both cases, export a flattened copy, or delete the hidden pixels permanently on a copy, before sharing.