Sub topic 8
Growing, shrinking, smoothing, and feathering a selection
This chapter assumes you can already make a selection with the Quick Selection, Object Selection, or Lasso tools. It also assumes you know the Layers panel and the Options bar. The first draft of a selection is rarely clean. It may be a few pixels too large, have a ragged outline, or leave a bright fringe of the old background. The Select > Modify commands fix these problems numerically, so you can repeat a result and reproduce it on another image.
What the Modify commands do
Select > Modify holds five commands. Each one changes the shape of the selection outline or the softness of its edge. None of them changes the pixels of your image.
| Command | What it does | Typical range | Typical use |
|---|---|---|---|
| Border | Replaces the selection with a band centered on the old edge | 1 to 200 px | Outlines, edge-only adjustments |
| Smooth | Rounds jagged corners and removes stray specks | 1 to 100 px sample radius | Cleaning up Quick Selection or Magic Wand results |
| Expand | Grows the selection outward | 1 to 100 px | Covering a fringe, giving a fill room to blend |
| Contract | Shrinks the selection inward | 1 to 100 px | Trimming halos off a cutout |
| Feather | Blurs the edge into a gradual transition | 0.1 to 1000 px | Soft blends, vignettes, natural cutouts |
Each command opens a dialog with one numeric field. Values are in pixels, so the same number has a different visual effect on a 1,000 px image than on a 6,000 px image. Scale your values to the resolution you are working at.
Expand and Contract
Expand moves every point of the selection outline outward by the number of pixels you enter. Contract moves it inward by the same rule. Both commands round off sharp corners as they work. A rectangle expanded by 20 px ends up with slightly rounded corners, and you should expect that.
Common uses:
- Remove a halo. A cutout often keeps a thin line of the old background color along its edge. Contract the selection by 1 to 3 px before you copy it to a new layer or add a mask.
- Give a fill room. Before Edit > Fill with Content-Aware, or before running Generative Fill, expand the selection by 4 to 10 px. The selection then reaches beyond the object's soft edge, shadow, or anti-aliased fringe, and the fill has clean surrounding pixels to sample.
- Match a selection to a shape. If Object Selection cut slightly inside an object's edge, a 1 or 2 px Expand often fixes it quicker than re-selecting.
Contract has a failure mode. A thin feature, such as a hair, a wire, or a narrow strap, disappears if the contract value is larger than half its width. Small selections can vanish entirely. When Photoshop reports that no pixels are selected, undo and use a smaller value.
Both dialogs include Apply effect at canvas boundaries. It matters when the selection touches the edge of the image. Leave it unchecked and the selection stays attached to that canvas edge. For example, a contracted selection will not pull away from it. Check it and the edge behaves like any other part of the outline, so the selection shrinks away from the canvas edge or grows past it. For a subject cropped by the frame, the unchecked setting is usually what you want.
Smooth
Smooth replaces the outline with a rounder version. Its Sample Radius field controls how far Photoshop looks around each point. Photoshop checks the pixels within the radius, and each pixel takes the state (selected or not) held by most of its neighbors. Narrow notches fill in and isolated specks drop out.
Typical values:
| Sample radius | Effect |
|---|---|
| 1 to 3 px | Removes single-pixel stair-stepping |
| 4 to 10 px | Removes small specks and ragged bays from color-based tools |
| 20 px and above | Rounds off real detail such as fingers, leaves, and corners |
Smooth works best on selections made by color-driven tools, because the Magic Wand and the Quick Selection tool leave holes and noisy edges. It works poorly on selections with intentional fine detail. A radius of 5 px applied to a tree selection erases small branches.
Smooth also has the Apply effect at canvas boundaries checkbox. It follows the same rule as in Expand and Contract.
Feather
An ordinary selection edge is a hard line. Each pixel is either selected or not, apart from a one-pixel anti-aliased transition. Feather replaces that hard line with a gradient. Pixels along the edge become partially selected, and an adjustment or fill applied there blends in gradually.
The feather radius sets the width of that transition. The gradient spreads across both sides of the original edge, so the soft zone is wider than the radius number suggests. A 20 px feather does not simply stay inside or outside the selection.
You can feather in two places:
- Before you draw. The Lasso tools and the Marquee tools have a Feather field in the Options bar. Photoshop applies that value to every selection you draw, until you reset it to 0. Beginners often leave a feather value set and then wonder why every later selection looks soft.
- After you draw. Use Select > Modify > Feather (Shift+F6). You see the result immediately in the marching ants, and you can undo and retry.
The second method is safer. A forgotten Options bar value affects every future selection, while the command affects only the current one.
Feather has three common problems:
- The edge disappears. Photoshop warns that no pixels are more than 50% selected. Your feather radius is too large for the selection, because the gradient has nowhere to go. Reduce the radius or work on a larger selection.
- Corners round off. A feathered rectangle loses its sharp corners. Feather only the selections that should be soft.
- Feathering changes the result of later commands. A feathered selection has partial pixels, so Contract or Smooth applied afterward may behave unpredictably.
Feather radii depend on image size. A 2 px feather gives a natural cutout edge on a web graphic and is almost invisible on a 6,000 px print file. A vignette on that print might need 200 px or more.
Order of operations
The Modify commands do not commute. Applying them in a different order gives a different selection. A reliable sequence is:
- Smooth, to remove noise while the edge is still hard.
- Expand or Contract, to move the edge to the right place.
- Feather last, to soften it.
Feathering first would blur the edge, and Smooth would then work on a gradient instead of a clean outline. As a rule of thumb, shape the outline with Smooth, Expand, and Contract, then soften it with Feather.
Border
Border turns the selection into a band that follows the outline. The width you enter is centered on the old edge, so a 10 px border covers about 5 px inside the edge and 5 px outside it. The interior of the old selection is no longer selected.
Uses include:
- Adding a stroke or glow around an object on a separate layer, by filling the border band.
- Adjusting only the edge zone, for example darkening the rim of a photo or fixing color spill along a cutout.
- Building a frame effect by selecting the whole canvas and then applying a border.
Border does not change the original selection permanently. Save the selection first if you will need it again, because the band replaces it.
Grow and Similar
Two related commands sit in the main Select menu, outside Modify. They add pixels by color instead of by distance.
- Grow adds neighboring pixels whose color is similar to the current selection. It uses the Tolerance value from the Magic Wand's Options bar.
- Similar does the same, but it searches the whole image, including areas not touching the selection.
Use them when a color-based selection is nearly complete but misses patches, such as a sky with gradient bands. Raise Tolerance first if the commands add too little, and lower it if they spill into the wrong area.
Scripting the same changes
Every Modify command has a scripting equivalent. This is useful for batch work where each image needs the same cleanup. The following ExtendScript runs from File > Scripts > Browse and applies a standard cleanup to the active selection.
// Smooth, trim 2 px, then soften 1 px on the current selection.
var doc = app.activeDocument;
try {
doc.selection.bounds; // throws if nothing is selected
} catch (e) {
alert("Make a selection first.");
throw e;
}
doc.selection.smooth(4);
doc.selection.contract(UnitValue(2, "px"));
doc.selection.feather(UnitValue(1, "px"));The script follows the order from the previous section: smooth, then contract, then feather. The smooth method takes a plain number for the sample radius, so the code passes 4. The contract and feather methods take a UnitValue, so you set the unit yourself instead of relying on the ruler preferences.
Common mistakes
- Feathering before checking the edge. A soft edge hides problems you should have fixed with Smooth or Contract.
- Using the same pixel value on every image. Scale values to resolution, as described earlier.
- Chaining Modify commands without saving. If the result is wrong after three steps, undoing each one is slow. Save the starting selection with Select > Save Selection first.
- Expecting Feather to be visible. The marching ants mark the 50% point of the gradient. The soft edge itself is invisible until you apply a fill or adjustment, so judge the result by the effect, not the outline.
- Skipping Select and Mask. Modify commands move an outline uniformly. They cannot recover fine, variable detail such as hair. For that, use the Select and Mask workspace, which the next chapter covers.
Exercises
Exercise
A cutout of a person has a thin white line along the edge from the old background. You also want the edge to look natural, not razor sharp. Which Modify commands do you apply, in what order, and with what rough values on a 3,000 px image?
Show answer
Contract by about 1 to 3 px to move the edge inside the white fringe, then Feather by about 0.5 to 1 px to soften it. If the outline is also jagged, run Smooth with a radius of 2 to 4 px first. Feather goes last because softening before shaping blurs the edge the other commands work on.
Exercise
You feather a small selection by 80 px and Photoshop warns that no pixels are more than 50% selected. What does the warning mean, and how do you fix it?
Show answer
The feather gradient is wider than the selection can support, so no pixel remains more than half selected and the marching ants cannot be drawn. Undo, then use a smaller radius or start from a larger selection.
Exercise
A Quick Selection of a hedge leaves small holes inside and a ragged outline. Which command targets both problems, and what is the risk of setting it too high?
Show answer
Smooth with a modest sample radius, such as 4 to 8 px, fills small holes and rounds the outline. A high radius, such as 20 px or more, also erases real detail like leaf edges and narrow gaps.