Techniques

Unsharp Mask Unveiled

by Tim Grey | December 28, 2008

Sharpening continues to be one of those topics that photographers seem to struggle with the most. It is certainly a subject that attracts a considerable number of questions in my Digital Darkroom Questions email newsletter, and one that inspires considerable debate. In an effort to address these concerns, I’ll present a series of articles on sharpening here at NatureScapes.net.

What is Sharpening?

When defining what sharpening is, I think it might be even more important to define what it isn’t. Sharpening your images won’t make up for an image that was captured out of focus or was blurred by camera or subject movement during the exposure. Sure, you can help mitigate such problems, but the results will never be as good as capturing a tack-sharp image in the first place. There’s no replacement for getting it right in the camera.

Sharpening an image is really a way to enhance existing detail in the image so it is more crisp and impactful. The way I typically describe sharpening is that it enhances contrast in areas where contrast already exists. Areas of contrast in your image are what you can think of as “edges” for the objects in the image. By enhancing contrast along those edges, the perceived sharpness of the image improves.

Lion yawning © Tim Grey

This lion photo has a mix of fine detail and smooth areas.

Sharpening is important to compensate for the loss of sharpness that is a byproduct of converting a continuous-tone scene in front of the lens into discrete digital signals at the imaging sensor, to improve the overall aesthetic quality of the image, and to compensate for the loss of sharpness that occurs when an image is printed (such as due to “dot gain,” whereby the ink spreads when it hits the paper).

For the purposes of this article, we’ll focus our attention on the Unsharp Mask filter in Photoshop, which is a typical tool for enhancing the sharpness of an image. You can apply the principles presented here to most other tools for sharpening your images. To get started with Unsharp Mask, choose Filter > Sharpen > Unsharp Mask from the menu in Photoshop.

Amount

As I’ve mentioned, sharpening an image is actually a process of enhancing edge contrast within the image. The Amount setting in Unsharp Mask controls the intensity of the contrast being added. A higher value means more contrast will be added, and a lower value means less contrast will be added.

Different images will naturally call for different settings, and the key consideration is the level of detail within the image. In images with fine detail, contrast transitions over a relatively short distance define the edges of objects. For example, small branches of a tree that is relatively small in the frame, or fur on an animal (even when relatively large in the frame) represent fine detail with contrast edges that are very close together.

Because the contrast being added to the image must therefore be very small, that contrast will need to be added with greater intensity for images with fine detail. As a general rule, that will call for an Amount setting somewhere in the range between about 175% and 225%. (Smaller images will call for settings at the lower end of the range, and larger images will call for settings at the higher end of the range.) The best value will vary for different images at different sizes, but this will give you a good starting point.

With images that don’t contain such fine detail, the contrast transitions that define the edges of objects occur over a bigger distance. As a result, you’ll need to have the contrast enhancement also transition over a larger distance, but it can’t be as intense or it will become more dominant than the actual edges you’re trying to enhance. Therefore, with images that don’t contain much fine detail you’ll probably use an Amount setting of between 75% and 125%.

Radius

When enhancing contrast along edges in an image, you’re effectively adding a “halo” at each edge area. I realize most photographers consider halos to be a bad thing when it comes to sharpening, but they’re actually a byproduct of sharpening and thus a good thing (or at worst a necessary evil). They only become truly problematic when they are either too intense (caused by an Amount setting that is too high) or too large (caused by a Radius setting that is too high).

The Radius setting is actually the most important setting in Unsharp Mask, since it defines the size of the area within which contrast is enhanced for all edges in the image. The Radius setting needs to be a reflection of the size of the edge transitions in the image, which means it will have an inverse relationship with the level of detail (and with the Amount setting). So, for images with fine detail, you’ll need to use a low Radius setting so that the sharpening halos are very small, commensurate with the size of the edge transitions in the image. In general that means a Radius setting of between about 0.5 pixels and 1.5 pixels. For images without fine detail, you’ll need to use a relatively high Radius setting, generally between about 2.0 and 3.0 pixels.

Unsharp Mask screenshot

Choosing a balance of Amount and Radius creates suitable sharpness for the lion’s whiskers.

The key thing to keep in mind when adjusting the Amount and Radius settings is that the settings need to have an inverse relationship. A high setting for Amount calls for a low setting for Radius, and a low setting for Amount calls for a high setting for Radius.

Threshold

So far I’ve been talking a lot about edges in the image, but we haven’t actually defined which edges Unsharp Mask will actually pay attention to. An area is considered an edge if there is adequate contrast (difference in value) between two adjoining pixels. The question then is how much contrast is enough for two pixels to be considered edge pixels, and that is defined by the Threshold value.

The Threshold control allows you to specify how much tonal value difference (based on 8-bits per channel, so with a range of 256 possible tonal values) there must be between two pixels in order for them to be considered a contrast edge. So, for example, if you set the Threshold value to 10, there must be a difference of at least 10 tonal value levels between two pixels in order for them to be considered an edge and thus have a contrast enhancement applied.

Unsharp Mask Threshold settings

With the Threshold value set to 0, the blurred area becomes too grainy.

Raising Threshold value

Raising the Threshold value to 4 preserves the smooth quality.

The real reason you care about the Threshold setting is the ability to have areas with relatively smooth textures (which means relatively small variations in tonal values) protected so they aren’t sharpened, thus retaining the smooth appearance of those areas. A good example is an open sky. You don’t want the sky to become textured because every variation in tonality among the pixels in the sky had a contrast enhancement applied.

When adjusting Threshold you’ll want to look at an area of the image that contains a smooth texture you want to protect, and then increase the Threshold setting to a value just high enough to remove the sharpening effect from those smooth areas.

About the Author

Tim Grey is an educator in digital photography and imaging, offering clear guidance on complex subjects through his writing and speaking.

Tim has written more than a dozen books on digital imaging for photographers, has published dozens of video training courses, has had hundreds of articles published in magazines such as Digital Photo Pro and Outdoor Photographer, among others. For more than a dozen years he has been publishing the daily Ask Tim Grey eNewsletter, answering questions from photographers, and produces the related Ask Tim Grey Podcast. He also publishes the monthly Pixology electronic magazine, and publishes video training courses through GreyLearning.com. Tim teaches through workshops, seminars, and appearances at major events around the country and around the world.

Tim can be reached via email at tim@timgrey.com.

Post a Comment

Logged in as Anonymous