Sub topic 7
Edge Detection: Radius and Smart Radius
This chapter assumes you can open an image in Photoshop, work with layers and the Layers panel, and read marching ants. It also assumes you know that a layer mask hides with black and reveals with white. You should have a base selection from Select Subject and the Select and Mask workspace open, with a view mode chosen so you can see the edge clearly.
What Edge Detection does
A selection made by Select Subject has a boundary that is one pixel wide. Hair does not work that way. Strands cross the boundary, and a band of pixels along the edge is part subject and part background. Edge Detection tells Photoshop to look at that band and decide, pixel by pixel, how much of each pixel belongs to the subject.
The control sits in the Properties panel of Select and Mask, under Edge Detection. It has two parts:
- Radius sets how wide the band is, measured in pixels on each side of the selection boundary.
- Smart Radius is a checkbox that lets Photoshop vary that width along the edge instead of using one number everywhere.
Inside the band, Photoshop refines the selection using the color and contrast of the image. Outside the band, the original selection stays as it was. That means Radius only changes pixels near the boundary. A strand that sits far outside the band is not recovered, however good the algorithm is.
How Radius works
Radius is a search distance. Photoshop looks within that distance of the boundary for edges, such as the line where a dark strand meets a light wall. It then moves the selection toward those edges.
The result depends on the value:
- A small radius (1 to 3 px) keeps the edge tight. It suits hard edges such as a jacket collar, but it leaves out loose hair.
- A medium radius (5 to 15 px) can capture short flyaway strands and the soft edge of fur on a sharp photo.
- A large radius (20 px and up) captures long, scattered strands. It also pulls in background, because the band now covers pixels that are mostly background.
Radius is measured in image pixels, so the right value depends on resolution. A 6000 px wide photo needs a larger radius than the same photo scaled to 1500 px. Do not copy a number from a tutorial or an earlier job. Judge it by eye.
The Show Radius option
Next to the Radius slider is Show Radius. When it is on, Photoshop shows the band as an overlay and displays the original image inside it. This shows you where Photoshop is allowed to work. If a strand lies outside the shown band, raise Radius or use the brush that is covered in the next chapter. Turn Show Radius off when you want to judge the result itself.
How Smart Radius works
With a fixed radius, one number has to serve the whole outline. Most portraits need two different treatments. The shoulders and jaw have crisp edges and need a narrow band. The hair has soft, scattered edges and needs a wide one. A single wide radius makes the shoulders look chewed. A single narrow radius loses the hair.
Turning on Smart Radius lets Photoshop adjust the band width along the edge. It narrows the band where it detects a sharp transition and widens it where the edge is soft or fine. The Radius value then acts as a ceiling for the band rather than a fixed width.
Smart Radius is not a guarantee. It makes its decision from local contrast, so it can misjudge:
- Where hair and background have similar tones, such as dark hair against a dark wall, it may see no edge and treat the area as soft.
- Where the background is busy, such as foliage or a patterned wall, it may follow background texture.
- Where a hard edge sits next to fine hair, such as a collar under long hair, the band may be wider than you want.
In those places, tune the result with the brushes instead of changing the global value.
Choosing values: a workflow
Follow this order each time. It avoids the common mistake of making the band too wide and then trying to repair the damage with other sliders.
- Set a view mode that contrasts with the hair. On White suits dark hair, and On Black suits light hair. Overlay or Onion Skin can also help with subtle edges.
- Turn on Smart Radius first.
- Set Radius to a low value, such as 3 px.
- Turn on Show Radius and check that the band covers the zone where hair crosses the edge.
- Raise Radius slowly while watching the hair. Stop when the finest strands you care about appear, and not when the whole background is inside the band.
- Turn off Show Radius and judge the edge. Look for background color in the gaps between strands.
- Compare with Smart Radius off. If the hard edges look better, leave it on. If they look worse, turn it off and rely on brushes.
A useful rule: if you raise Radius and the hair looks better but the shoulders, collar, or ears look worse, the radius is not the problem. You need Smart Radius, or you need to brush the two regions differently.
Reading the result
Do not trust a single view. After each change, check the edge in at least two modes. A cutout that looks clean On White may show a gray cloud On Black, because the algorithm kept background pixels that happened to be light.
Watch for these signs:
| What you see | Likely cause | What to try |
|---|---|---|
| Hair looks cut off or blunt | Radius too small, or strands outside the band | Raise Radius, or paint with the Refine Edge Brush |
| Hair looks fine but has a fuzzy cloud around it | Radius too large | Lower Radius, or paint those areas back with the Refine Edge Brush set to subtract |
| Hard edges look rough or hairy | Smart Radius off with a large Radius | Turn on Smart Radius |
| Hard edges look soft | Smart Radius widened the band | Lower Radius, or use the Smooth slider lightly |
| Light halo along the edge | Background color remains in edge pixels | Leave this for Decontaminate Colors |
The last row matters. Edge Detection decides how much of each pixel is selected. It does not change the color of those pixels. A halo is a color problem, and a larger radius will not fix it.
Edge cases and common errors
Judging in the wrong view
If you tune Radius while viewing On Layers or in Marching Ants, you are not seeing partial transparency. Switch to a solid-color view before you settle on a value.
Radius that is too large for the image size
If you resize the image later, the same Radius covers a different amount of the picture. Set the value on the file at its working resolution, and do not carry it between files of different sizes.
A low-contrast edge
When hair and background are close in tone and color, edge detection has little to work with. A bigger Radius will not make it find an edge. It will only widen the area where Photoshop guesses. Use the brush with a moderate size, or consider the channel-based method covered at the end of this tutorial.
The base selection is wrong
Edge Detection refines an outline. It cannot rescue an outline that cuts through the head or leaves a large piece of the background inside. If the band is in the wrong place, go back and fix the base selection first. The Quick Selection or Lasso tools in the Select and Mask toolbar can add or remove large areas.
Starting from a hard-edged selection
If the base selection has a very jagged edge, Radius spends its effort smoothing that edge and not finding hair. A clean base selection leaves the band free to do its actual job.
Practice: a repeatable test
Open any portrait with loose hair. Set the view to On White and go through this pass:
- With Smart Radius off, set Radius to 0, then to 10, then to 40. Note how the hair and the shoulders each change.
- Turn Smart Radius on and repeat with the same three values.
- Write down which setting kept the shoulders sharp and still captured the hair.
This takes about five minutes and shows you how the two controls interact on your own images.
Exercise
You set Radius to 30 px with Smart Radius off. The hair looks full, but the shoulders and collar now look fuzzy. What are two ways to fix this without losing the hair, and why does each work?
Show answer
First, turn on Smart Radius. It narrows the band where it detects a sharp transition, so the collar and shoulders become crisp while the hair keeps a wide band. Second, lower Radius to a moderate value and use the Refine Edge Brush only over the hair. This puts the wide search area only where it is needed. In both cases the fix works by limiting the wide band to the hair instead of applying it to the whole outline.
Exercise
After raising Radius, you see a thin light line around the hair when you view On Black. Will raising Radius further remove it? Explain.
Show answer
No. The line is background color left in the edge pixels, which is a color problem. Radius changes how much of each pixel is selected, not the pixel's color. Use Decontaminate Colors to fix it.