Three scales, three different operators
A photograph carries information at every spatial scale at once, and the three controls on this page act on three bands of it. Nothing about that is a matter of taste: the radius is a number of pixels, and which band a pass lands in is decided by that number and nothing else. Setting the right one is most of the skill.
| Pass | Radius | What it moves |
|---|---|---|
| Unsharp mask | 0.3–8 px | The transition across an edge: an eyelash, a wire, the line of a roof |
| Structure | 8–20 px | Texture: weave, grain, brickwork, foliage read as foliage |
| Clarity | 20–80 px | Form: the separation between a face and the wall behind it |
Because the numbers are pixel counts, the same setting behaves differently on a 3 megapixel file and a 40 megapixel one. Clarity at radius 40 on a small frame is acting on form; on a very large frame it is closer to texture. That is a property of the operation rather than a shortcoming of the control, and it is one more reason the inspection view works at one image pixel per screen point.
Why the base layer is a guided filter
Every local-contrast pass is the same shape as an unsharp mask: subtract a smoothed copy, multiply the difference, add it back. The whole question is what smoothed copy. With a Gaussian, the smoothing crosses strong edges freely, so near a bright-against-dark boundary the base layer is pulled towards the wrong side and the difference layer over-corrects in a band the width of the radius. At radius 60 that band is sixty pixels of visibly wrong sky above every hillside, and it is the single most recognisable artefact in over-processed landscape photography.
A guided filter solves a small linear regression of the picture against itself inside every window instead. Where the window is flat, the fit has almost no slope and the output is the local mean, which is exactly the smoothing that is wanted. Where the window straddles a step, the fit has a large slope and reproduces the step rather than averaging over it. The cost is four box filters instead of one, and box filters are constant-time in the radius, so a radius-80 pass costs no more than a radius-8 one.
Questions that arrive with a flat photograph
- Is clarity just sharpening with a bigger number?
- No, and the difference is worth holding on to. Sharpening works at the scale of an edge — one or two pixels either side — and makes a step steeper. Clarity works at a scale of twenty to eighty pixels and changes how a whole region sits against the region next to it. A picture with clarity applied has exactly as much edge definition as it had before; what it has gained is separation between the parts. Applied to a portrait, sharpening finds eyelashes and clarity finds cheekbones.
- Why does clarity leave a dark band along the horizon in other tools?
- Because the base layer those tools subtract is a plain Gaussian blur, and a Gaussian blur near a strong step is pulled hard towards the other side of the step. The difference layer then over-corrects in a band as wide as the radius, which reads as a grey halo in the sky above a dark hillside. The base layer here is a guided filter instead — a local linear fit of the picture against itself — which follows a step rather than averaging across it, so the difference layer stays flat where the picture is flat.
- The sky has developed visible steps between shades. What happened?
- Banding, and clarity is the usual cause. The pass stretches the distance between neighbouring tones, and in a smooth gradient across a clear sky the stretched distance can exceed one 8-bit code value where before it did not — so a boundary appears where the quantiser rounds one way rather than the other. The pass dithers by half a code value before rounding to hold that off, which turns the step into a fine stipple the eye integrates. Past about 40 the stretch can outrun the dither, and the answer is a lower setting rather than more processing.
- After a strong clarity setting the midtones look heavy. Is there a fix here?
- Not on this page, and the honest answer is that there should not be. Clarity darkens midtone shadows as a direct consequence of what it does — it pushes darker regions further from their lighter neighbours — and the correct response is a small exposure or shadow lift, which is a global tonal adjustment. That is a different tool with a different purpose, and adding one here would make this page a general image editor by accident.
- What does the structure control do that clarity does not?
- The same arithmetic at a smaller radius: eight to twenty pixels, sitting between clarity and the unsharp mask. It is the band that carries texture rather than form — the weave in fabric, the grain in wood, the tiles on a distant roof. It is more likely than clarity to make noise visible, because at that radius the base layer and the noise are closer in scale, which is why the balance control and the measured noise figure matter more once it is in use.