Image Processing & Filtering

unsharp masking

Unsharp masking is the most widely used sharpening technique, and its name is a delightful piece of counterintuition inherited from film darkrooms: you sharpen an image by means of a blurred (unsharp) copy of itself. The idea is that subtracting a blurred version from the original isolates exactly the fine detail and edges, the high-frequency content, that blurring removed. Add that detail layer back, scaled up, and the edges become more pronounced, making the picture look crisper.

The recipe is sharpened = original + amount * (original - blur(original)). The term in parentheses, original minus a Gaussian-blurred copy, is a high-pass residual: it is near zero in flat regions and large with the right sign on either side of an edge. Three knobs control it: amount sets how strongly the detail is boosted; the blur radius (the Gaussian sigma) sets the scale of features sharpened, small radius for fine texture, large radius for broad local contrast; and a threshold can be applied so that only differences above some size are amplified, which prevents sharpening flat areas and thereby avoids boosting noise. For a small blur, this is mathematically close to subtracting a scaled Laplacian.

Unsharp masking does not actually recover lost information, it cannot un-blur, it only exaggerates the contrast that is already present at edges to exploit a perceptual illusion: our visual system reads steeper edge transitions as sharper. The price is overshoot: near a strong edge the boosted residual pushes pixels past their natural values, creating bright and dark halos (ringing) along the edge. Too much amount also amplifies noise and can clip highlights and shadows to pure white or black. Skilled sharpening is a balance of amount, radius, and threshold against these artifacts.

Sharpening text with radius 1 and amount 1.5 darkens the inside of each stroke and lightens the paper just beside it, the letters pop, but push amount to 4 and a grey-and-white halo rings every character.

Pitfall: oversharpening is instantly recognizable as halos, those bright/dark outlines hugging high-contrast edges. Use the threshold parameter to leave smooth regions (sky, skin) untouched so you sharpen detail without turning noise into texture.

Also called
USMunsharp mask sharpening