Forum Login

Understanding the Unsharp Mask

Of all the tools available in digital image processing none causes more confusion than the use of Unsharp Masking. I believe that this is in large measure because users don't understand what each of the three tools, Radius, Amount and Threshold actually does. The mystery is now revealed.

By: Dale Cotton

Defining Sharpening

Sharpening is about restoring accutance that has been lost previously along the image capture chain of events. Accutance = how precisely the edges of things are defined. Fuzzy edges = rub eyes, do I need new glasses?

But if the edges have been blurred during digitization how can the lost detail that defined the edges be recovered? It can't be; the first law of computing is garbage in — garbage out. So we resort to the old law that two wrongs make a right. We throw away even more information in the hopes that what is left gives the illusion of the original Accutance

The principle behind unsharp masking is exaggerating the contrast between the two sides of an edge. By way of example, suppose the edge is the boundary between a pink rose petal and a green leaf behind it. Looking at some portion of this boundary in Photoshop at high magnification what we see is like looking at the original scene but through the kind of screen used for windows and doors to keep out insects. Crucial transitions are missing. The eye cries out for clarity but finds only ambiguity. One wants to take a piece of masking tape, lay it down along one's best guess where the edge should be, then colour everything on one side pink and everything on the other side green.

Yellow Dawn. Algonquin Park. May, 2003
Canon 1Ds with Canon 500mm f/4L IS @ ISO 100


That's what USM tries to do, but the crux is where to put the masking tape? From a distance the edge of a rose petal may seem to be a pretty straightforward curve, but close-up there are probably serrations, insect nibbles, and most of all shadows and reflections. When the edge involved is that between one green leaf and another, the decision of which pixel belongs to which leaf becomes even less clear-cut.

USM is an algorithm that goes through the entire picture one pixel at a time, asking this question: shall I leave the hue of this pixel unchanged or shall I change it? To make that decision it looks at that pixel's neighbors. If the neighborhood seems to be divided into pink pixels and green pixels, the algorithm will declare an edge as being the dividing line between the pink and green regions.

Defining the Parameters

The Radius parameter, then, is the distance from the pixel in question that the algorithm considers to be that pixel's neighborhood. Amount is how aggressively the hue is modified, and Threshold is how different in hue two adjoining regions must be before they are declared to be separate sides of an edge.

But once USM has decided where an edge is, how does it actually "sharpen" it? One of the strongest cues the human optic system uses to decide where one object ends and the next begins is an abrupt change from dark to light. Most objects, being three dimensional, have shadowing along at least one edge. So, like certain religious orthodoxies, USM loves to draw the line between darkness and light. As Amount increases dark areas get darker and light areas get lighter, eventually leading to sanctifying the good pixels (light-hued) with haloes of white, and damning the bad pixels (dark-hued) to the oblivion of pure blackness. Zoom to 500% in an image, then drag each of the USM sliders to left and right and you can see these principles in action.

Filed Under:  

show page metadata

Concepts: Image processing, Digital imaging, Color, Acutance, Unsharp masking, Digital image processing, Pressure sensitive tape, Digital camera

Entities: Algonquin Park, USM, Photoshop, confusion, Michael Reichmann, Dale Cotton

Tags: pixels, edge, unsharp masking, green leaf, Amount, digital image processing, certain religious orthodoxies, image capture chain, accutance, algorithm, USM sliders, Fuzzy edges, Dale Cotton, Crucial transitions, rub eyes, masking tape, large measure, best guess, pink pixels, Yellow Dawn, new glasses, high magnification, good pixels, green pixels, straightforward curve, Most objects, Radius parameter, separate sides, entire picture, bad pixels, strongest cues, Algonquin Park, old law, pure blackness, original scene, original accutance, dividing line, abrupt change, insect, petal