Sub topic 5
Making masks from selections
This chapter assumes you can make selections with the Marquee, Lasso, and Quick Selection tools. It also assumes you know what a layer mask is and that white reveals, black conceals, and gray blends. Here you will turn selections into masks, control what the mask captures, and fix the errors that come up most often.
What a selection becomes
A selection is a boundary that marks some pixels as selected, fully or partly. When you create a mask while a selection is active, Photoshop converts the selection into grayscale values:
- Fully selected pixels become white, so they stay visible.
- Unselected pixels become black, so they are hidden.
- Partly selected pixels become gray. This happens along feathered or anti-aliased edges.
A selection and a mask hold the same kind of information. This is why you can move between them freely. A selection can become a mask, and a mask can be loaded back as a selection.
Creating a mask from an active selection
With a selection active and the target layer chosen in the Layers panel, click the Add Layer Mask button at the bottom of the panel. The selected area stays visible and everything else is hidden.
Other ways to create the mask:
| Action | Result |
|---|---|
| Click Add Layer Mask | Selected area is revealed, the rest is hidden |
| Alt-click (Windows) or Option-click (Mac) Add Layer Mask | Selected area is hidden, the rest is revealed |
| Layer > Layer Mask > Reveal Selection | Same as a plain click |
| Layer > Layer Mask > Hide Selection | Same as the Alt/Option click |
The Alt/Option click saves a separate invert step. Use it when you selected the thing you want to remove, such as a sky you plan to replace or a distracting object.
Worked example: isolating a subject
Suppose you have a photo of a person and want to place them on a new background.
- Open the photo and unlock the Background layer by double-clicking it. Click OK to make it a regular layer. A locked Background layer cannot take a mask.
- Choose the Quick Selection tool and drag across the person until the marching ants outline them.
- Click Add Layer Mask.
- Place a new background layer beneath the person's layer.
The person stays, and the old background is hidden, not deleted. If the edge looks rough, you can paint on the mask to fix it, as covered in the previous chapter.
Soft edges at creation time
A hard-edged selection gives a hard-edged mask. For photos, that usually looks like a cutout. You have three ways to soften the edge.
- Feather the selection before masking. Choose Select > Modify > Feather and enter a radius in pixels. The radius is permanent once you create the mask.
- Create the mask first, then use Feather in the Properties panel. This is adjustable at any time and does not commit you to a value. The next chapters cover it.
- Use Select and Mask. It offers Smooth, Feather, and Shift Edge, along with edge detection for hair and fur.
Prefer the second route when you are unsure. A feather baked into the selection can only be undone with History or by redoing the mask. The Properties panel feather can be changed again later.
Loading a mask back as a selection
The conversion works in both directions. To turn an existing mask into a selection, Ctrl-click (Windows) or Cmd-click (Mac) the mask thumbnail. Gray values load as partial selections, so a soft mask gives a soft selection.
You can combine this with modifier keys:
- Ctrl+Shift-click (Cmd+Shift on Mac) adds the mask to the current selection.
- Ctrl+Alt-click (Cmd+Option on Mac) subtracts the mask from the current selection.
- Ctrl+Alt+Shift-click (Cmd+Option+Shift on Mac) intersects the mask with the current selection.
Loading a mask is useful for reusing one mask on another layer. Load the first mask, select the second layer, then click Add Layer Mask.
Selection tools and what they suit
The tool you choose affects how much cleanup the mask needs afterward.
| Tool | Best for | Typical cleanup |
|---|---|---|
| Rectangular or Elliptical Marquee | Geometric shapes, vignettes | Feather for a soft edge |
| Lasso or Polygonal Lasso | Irregular shapes with clear edges | Smooth or feather the edge |
| Quick Selection | Subjects with contrast against the background | Refine around edges |
| Object Selection | Distinct objects, people, animals | Check for holes and missed fine detail |
| Select > Sky | Replacing or adjusting a sky | Edit the edge near trees and buildings |
| Select > Subject | One-click subject isolation | Review the whole outline |
The automatic tools are fast but approximate. Treat their output as a first draft. Always view the mask on its own to look for holes, stray patches, and jagged edges.
Selections for local adjustments
You can make a mask from a selection for more than cutouts. If you add an adjustment layer while a selection is active, Photoshop builds the mask for you. For example, select a face with the Elliptical Marquee, feather it by 40 pixels, then add a Curves adjustment layer. Only the selected area receives the brightening.
This is the standard way to start a local adjustment, and the later chapter on adjustment layer masks builds on it.
Common problems and fixes
The Add Layer Mask button does nothing useful
If the mask comes out all white even though a selection is active, check these causes:
- The selection was lost. Check for marching ants before you click.
- The layer is a locked Background layer. Convert it to a regular layer first.
- A selection exists but is empty, for instance after Select > Inverse on a full-canvas selection.
The mask is the reverse of what you wanted
You revealed what you meant to hide. Click the mask thumbnail and press Ctrl+I (Windows) or Cmd+I (Mac) to invert it. Inversion changes the mask's values and leaves the layer's pixels alone.
A halo or fringe appears around the subject
Pixels at the cutout edge still carry color from the old background. Try these fixes in order:
- Shrink the mask slightly. Select the mask, choose Filter > Other > Minimum, and use a radius of 1 pixel.
- Use Select and Mask with Shift Edge set to a small negative value.
- Paint along the edge on the mask with a small, soft, black brush.
Jagged "staircase" edges
The selection was anti-aliasing off, or the selection was made at a low zoom level. Zoom in to 100 percent when judging edges. Turn Anti-alias on in the options bar for the Lasso and Marquee tools before you make the selection.
The edge moves when the layer moves
By default, a mask is linked to its layer, so both move together. If you move the layer and the mask does not follow, the link was broken. Click the chain icon between the thumbnails to relink them. The chapter on managing masks covers linking in detail.
Saving a selection for later
A selection disappears when you deselect, but a mask holds the same information for as long as the file exists. If you need a selection you may reuse, you have two options:
- Save it as an alpha channel with Select > Save Selection. It appears in the Channels panel and can be reloaded with Select > Load Selection.
- Keep it as a layer mask and load it with Ctrl-click or Cmd-click.
The layer mask route keeps everything in the Layers panel. The channel route is better when the selection is not tied to one layer.
Putting it together
A reliable sequence for most selection-based masks:
- Select the target layer and unlock it if needed.
- Make the best selection you can with the right tool.
- Click Add Layer Mask, or Alt/Option-click if you selected the area to hide.
- View the mask alone and check the edges.
- Fix gaps with a brush, and soften with Feather in the Properties panel.
Exercise
You used Select > Subject to select a dog, then clicked Add Layer Mask. The dog is visible, but the mask hides part of its ear. You also need the same cutout on a second layer. How do you fix the ear without damaging the layer, and how do you reuse the mask?
Show answer
Click the mask thumbnail so it is the active target, then paint with a white brush over the missing part of the ear. White reveals the layer's pixels, which were never deleted. To reuse the mask, Ctrl-click (Windows) or Cmd-click (Mac) the mask thumbnail to load it as a selection, select the second layer in the Layers panel, and click Add Layer Mask.
Exercise
You selected a sky with Select > Sky and want to replace it. Should you click Add Layer Mask or Alt/Option-click it, and why?
Show answer
Alt/Option-click. The selection covers the sky, which is the part you want to hide. Alt/Option-click creates a mask that hides the selected area and reveals the rest, so no extra inversion is needed.