Sub topic 9
Refining Edges in Select and Mask
This chapter assumes you can already make a selection with Quick Selection, Object Selection, or a Lasso tool. It also assumes you know how to add to and subtract from a selection, and that you understand feathering and the Select > Modify commands from earlier chapters. Here you will learn how the Select and Mask workspace works, what each control does, and where it tends to fail.
What Select and Mask is for
Select and Mask is a dedicated workspace for improving the edge of an existing selection. It is most useful when the edge is hard to describe with a simple outline, such as hair, fur, grass, or the soft edge of an out-of-focus object.
The workspace does three jobs:
- It lets you view the selection against different backgrounds, so you can judge the edge the way it will look in the final composite.
- It gives you tools that refine the edge, either by painting over it or by adjusting sliders.
- It lets you choose how the result is delivered, for example as a selection, a layer mask, or a new layer.
You can open it in several ways:
- Choose Select > Select and Mask.
- Press Ctrl+Alt+R (Windows) or Cmd+Option+R (macOS).
- Click the Select and Mask button in the Options bar while a selection tool is active.
If a selection is active, Select and Mask starts from it. If no selection is active, you can still enter the workspace and build one using the tools there, but starting from a good rough selection gives better results.
Workspace layout
The workspace has three areas.
- Toolbar (left). It holds the Quick Selection, Refine Edge Brush, Brush, Object Selection, Lasso, and Polygonal Lasso tools. It also has the Hand and Zoom tools.
- Options bar (top). It shows settings for the active tool, such as brush size, and the selection mode buttons.
- Properties panel (right). It holds the view settings, the edge-detection controls, the Global Refinements sliders, and the output settings.
The exact set of tools can vary slightly between Photoshop versions, so check your own toolbar if a tool is missing.
Choosing a view mode
The View menu in the Properties panel controls how the selection is displayed. Changing the view does not change the selection. It only changes how you judge it.
| View | What it shows | Best used for |
|---|---|---|
| Onion Skin | The selected area partly transparent over the original image | Checking how the edge sits against the original |
| Marching Ants | The standard moving outline | Seeing the exact selection boundary |
| Overlay | A colored tint over the unselected area, like Quick Mask | Finding stray unselected areas and holes |
| On Black | The selection over a black background | Spotting light fringes and halos |
| On White | The selection over a white background | Spotting dark fringes |
| Black & White | The selection as a mask, white for selected and black for unselected | Seeing partial transparency and holes |
| On Layers | The selection over the other layers in the document | Previewing against the real new background |
A useful habit is to switch between views often. A fringe that is invisible on white may be obvious on black. Press F to cycle through the views, and press X to temporarily show the original image.
Use On Layers whenever you already have the new background in your document. It is the most honest preview, because it shows the result against what you will actually use.
The refinement tools
Refine Edge Brush
The Refine Edge Brush is the main tool for difficult edges. You paint along the boundary, and Photoshop re-examines the pixels under the brush. It decides, pixel by pixel, how much of each belongs to the subject. This produces partial transparency, which a plain selection edge cannot do well.
How to use it:
- Select the Refine Edge Brush tool.
- Set a brush size slightly larger than the width of the fuzzy edge.
- Paint along the edge, for example along the outline of the hair.
- Release the mouse button and wait for the edge to update.
Hold Alt (Windows) or Option (macOS) while painting to subtract. This restores the original edge in that area.
The brush works best when the edge area under it contains both subject and background. If you paint too far into solid subject or solid background, the result can become blotchy.
Quick Selection and Brush tools
The Quick Selection tool in this workspace behaves as it does in the main toolbar. Use it to add or remove larger areas.
The Brush tool is for manual correction. Painting adds to the selection by default, and Alt/Option painting removes from it. Use it to fix small spots that the automatic tools got wrong. Unlike the Refine Edge Brush, it does not analyze the edge. It simply paints in or out.
Object Selection and Lasso tools
Object Selection and the two Lasso tools let you fix large mistakes without leaving the workspace. For example, you can lasso a missing shoulder and add it back. This saves you from leaving the workspace, correcting the selection, and re-entering it.
Edge Detection
Edge Detection tells Photoshop where to look for the true edge.
- Radius sets the width of the band around the selection border that is re-examined. A larger radius gives more room to find fine detail, such as wisps of hair.
- Smart Radius adjusts the radius automatically along the edge. Where the edge is sharp, such as a shirt collar, it uses a narrow band. Where the edge is soft, such as hair, it uses a wide one.
Use Show Radius to see the band as an overlay. If the band does not cover the fuzzy region, increase the radius.
The common mistake is setting a large radius with Smart Radius off. A large uniform radius softens the hard edges as well. This is why Smart Radius is often worth turning on for a subject that has both hard and soft edges.
A good starting approach:
- Turn on Smart Radius.
- Start with a radius of about 5 px for a typical photo, and increase it until the hair detail is covered.
- Use the Refine Edge Brush on any areas the radius did not cover.
Radius is measured in pixels, so the right value depends on image resolution. A radius that works at 1,000 px wide will be far too small at 6,000 px wide.
Global Refinements
These sliders change the whole edge at once. They correspond to the commands you saw in the earlier chapter on modifying a selection, with some differences.
| Control | Effect | Typical use |
|---|---|---|
| Smooth | Rounds jagged corners and bumps | Removing stair-step edges left by a rough selection |
| Feather | Blurs the edge uniformly | Matching a soft, out-of-focus subject |
| Contrast | Sharpens soft transitions in the edge | Cleaning up a feather that is too wide, or an edge made soft by a large radius |
| Shift Edge | Moves the border in (negative) or out (positive) | Removing a background halo by moving inward |
Two points are worth remembering.
First, Shift Edge with a negative value is the quickest fix for a bright halo of old background around a subject. A value of -10% to -30% is often enough. Large values eat into the subject.
Second, Feather and Contrast pull in opposite directions. Feather widens the transition, and Contrast narrows it. Using a high Feather and a high Contrast together mostly wastes effort. Pick the one you need.
Output Settings
The Output Settings decide what you get when you click OK.
Decontaminate Colors
Hair and other fine edges often keep color from the old background. For example, a person shot against a green wall can have green tints in their hair. Decontaminate Colors replaces those edge colors with colors from nearby pixels in the subject.
It has an Amount slider. A higher amount cleans more aggressively, but it can change the subject's real colors near the edge.
There is an important limit. Decontaminate Colors changes pixel colors, so it cannot output to a plain selection or a layer mask. Photoshop only allows it with outputs that create new pixels, which means New Layer or New Layer with Layer Mask, or a new document. If you turn the option on, the Output To menu limits its choices accordingly.
Output To
| Output | Result | Destructive? |
|---|---|---|
| Selection | An active selection | No |
| Layer Mask | A mask on the current layer | No |
| New Layer | The subject on a new layer, with the background removed | No, the original layer remains |
| New Layer with Layer Mask | The subject on a new layer, with a mask | No |
| New Document | The subject in a new file | No |
| New Document with Layer Mask | A new file with a masked layer | No |
For most work, choose Layer Mask or New Layer with Layer Mask. A mask keeps the edit reversible, because you can paint the mask later to bring back detail. The Decontaminate option is the one reason to pick a New Layer output instead.
A worked workflow
This sequence suits a portrait with flyaway hair, to be placed on a new background.
- Make a rough selection with Select Subject or Object Selection. Do not worry about the hair yet.
- Open Select and Mask.
- Switch the view to On Layers if the new background is in the document. Otherwise use On Black or On White.
- Turn on Smart Radius and raise the radius until the hair is covered. Use Show Radius to check.
- Paint along the hair with the Refine Edge Brush. Use Alt/Option to undo areas where it grabbed too much.
- Use Smooth at a low value, such as 2 to 5, to remove jagged parts of the body outline.
- Set Shift Edge to a small negative value to remove the halo.
- Turn on Decontaminate Colors and set Amount to about 50%, then raise it only if fringes remain.
- Set Output To New Layer with Layer Mask and click OK.
The diagram below shows the same flow.
Common problems and fixes
- The hair looks cut out and hard. The radius is too small, or the Refine Edge Brush was not used. Increase the radius and paint over the hair.
- A light outline surrounds the subject. This is a halo from the old background. Use a negative Shift Edge value and turn on Decontaminate Colors.
- The whole edge looks blurry. Radius or Feather is too high. Lower them, or add Contrast.
- Parts of the subject look see-through. The Refine Edge Brush treated solid subject as edge. Use Alt/Option with the brush to restore it, or paint the area white on the mask afterward.
- Decontaminate Colors is grayed out or the output menu is limited. The chosen output type does not support it. Pick a New Layer output.
- The result is too slow to preview. On very large images, the live preview can lag. Work on a reduced copy to find your settings, then apply the same values to the full image.
- Color shifts near the edge after decontaminating. The Amount is too high. Reduce it.
Limits to know about
Select and Mask improves edges, but it does not invent detail. Several cases remain hard:
- When the subject and background have nearly the same color and brightness, the edge detection has nothing to separate them.
- When hair is blown out to pure white against a white background, the fine strands are already lost in the photo.
- Glass, smoke, and similar transparent subjects are poorly served by a mask built from a selection. Other techniques, such as channel-based masks, handle them better.
In these cases, the choice of tool matters more than the refinement. The final chapter returns to this question.
Exercise
You have a portrait with wispy hair, and you want to place it on a new background. After refining, you see a green tint in the hair, and you also want the output to be a layer mask on the original layer. Which setting do you need, and what conflict will you run into?
Show answer
Turn on Decontaminate Colors to remove the green tint. It cannot be used with the Selection or Layer Mask outputs, because it changes pixel colors and so needs an output that creates new pixels. Choose New Layer with Layer Mask instead. This keeps a mask you can still paint, and it keeps the original layer untouched.
Exercise
A subject has a sharp-edged jacket and soft, fuzzy hair. You set a large Radius, and the jacket edge turns soft. What setting should you turn on, and what does it do?
Show answer
Turn on Smart Radius. It adjusts the width of the edge band along the border, using a narrow band on sharp edges such as the jacket and a wide band on soft edges such as the hair. This keeps the jacket crisp while still capturing the hair detail.