This tutorial covers the basics of sharpening digital images. I explain what exactly sharpening is, show some examples where it helps, explain how to choose the right parameters, and warn about some problems that can cause it to degrade your pictures. Sharpening is a large topic, so I've broken it up into two separate tutorials. A second tutorial covers some more advanced material, in particular how to get finer control and apply more sharpening exactly where required without making a mess where it is not.
I would be remiss if I didn't start out by mentioning Dan Margulis' work, in particular his book Professional Photoshop. I learned nearly everything I know about this topic from this book, in particular from Chapter 4: Sharpening with a Stiletto and from taking Dan's course. You should view this tutorial as at best a vast oversimplification of Dan's work. I've reread this chapter 4 times carefully, and each time I get more out of it. I cannot stress this too strongly: Anyone who is serious about getting the most from his or her photographs in digital post processing needs to have a copy of this book and make an extended study of it.
What is Sharpening and what can it do?
Sharpening can make your images look a lot, well, sharper. Here are a couple of before and after examples. The differences between these images aren't so easy to see at this size. Click on the images to see a larger size version.
In this demolition derby shot, look in particular at the door handle, ant the mesh seen through the back window, and at the dirt under the care. Look at the rooster's comb, his eye the feathers just to the right of his wing, and the ground directly beneath his feet. The difference is subtle, but makes a large difference in the overall perceived clarity of the images.
Sharpening is a very old technique for making the outlines of things look more distinct. It is so old that it predates photography by many hundreds of years. Maybe the all time most famous practitioner of sharpening of is the Spanish painter El Greco (1541-1614). Here is a painting of his called The spoliation, Christ Stripped of His Garments, completed in 1579:
Here is a detail from Christ's hand. See how El Greco has outlined the fingers with dark lines? See how this makes them stand out against Christ's robe in the full painting? This is an example of sharpening. Pretty good for a guy who couldn't afford Photoshop. Sharpening enhances the perceived sharpness of images by emphasizing the transitions between light and dark areas with halos. Just as El Greco drew a black halo around Christ's hand, sharpening draws halos at the points of transition. Actually, it draws two kinds of halos, a light and a dark halo. It both outlines dark areas with light halos and light areas with dark halos.
Let me illustrate with another image. In this case, I have deliberately over sharpened to make my point.
The difference between these two images looks like the difference between a cheap lens and one that cost a bundle, but really they are exactly the same except for one application of the basic Photoshop sharpening tool, USM. To see how this illusion has been created, let's take a look at a very close crop, before and after:
This is the bottom left of the "B" in "Believe". In the original the transition between blue and gray wasn't completely sharp. It shades from gray to blue over a couple of pixels. Dan says this is caused by, "the real life line of transition being narrower than ... even ... film ... can resolve." The after image shows clearly how the USM magic trick works. The dark blue area has been surrounded with a light colored halo in the gray area. And the lighter gray area has been surrounded with a darker colored halo in the blue area.
What sharpening can't do
Understanding how sharpening works leads to an understanding of its limitations. When I first heard about it, I thought, "Just what I need, a way to correct fuzzy out-of-focus shots." But sharpening cannot help where transitions aren't fairly crisp. It works by looking for transitions finner than some threshold (more about this soon.) If there are now such transitions, it does nothing and thus has no effect. Sharpening also can't help images without sharp transitions. Skin for example, is usually lacking in such transitions, and the ones that it does have are things we don't want to emphasize (wrinkles, pimples, etc.) On the other hand, portraits usually have things we do want to sharpen, eyes, hair, clothing, and things we really don't, skin for example. This is often true and a large part of the second tutorial is devoted to fine tuning so that sharpening does what we want and doesn't do what we don't want.
When to sharpen
Sharpen last after, any color correction, cropping, black and white conversion, not to mention composting and edits involving masks, brushes or cloning. Steepen curves after sharpening and you effectively change the amount parameter with unpredictable results. Sharpen before masking, extraction, composting, or cloning and you make you job all the harder and will likely end up with unnatural looking results. Once you become proficient at sharpening in post processing, you will want to disable in camera sharpening because you will want to sharpen yourself after other edits. Sharpening twice is generally a bad idea. Users of raw conversion software also will want to disable sharpening during conversion. Users of ACR should disable such automatic sharpening by following the arrow to the right of "Settings Selected Image" to the preferences menu. Option "Apply sharpening to preview images only".
Prepress professionals preparing images for publication sharpen with knowledge of the actual size of the reproduction, but that's probably to much to ask under most circumstances. If you are very prefectionistic, though, and want huge prints, it is a good idea to sharpen separately for them.
Unsharp mask recipe
The examples I gave above illustrate one of the frustrating things about sharpening. There is no pat formula that you can apply to all your photographs; each image requires some work to determine the correct sharpening parameters. It's actually worse than that. The correct sharpening parameters are also a function of the size the image will be reproduced. Large prints require a very light hand with the sharpening parameters. Images for posting on the Internet may require quite a bit of sharpening before the effect is noticeable and in many cases this poses insurmountable problems. The amount of sharpening required to make a visible difference is often so much that at least some parts of the image are over sharpened. Thus I usually take the approach of sharpening for largish sized prints and letting it go at that. In the cases where it matters most, this helps images posted on the web. It never make a mess. And it makes prints look great. The demolition derby and rooster pictures illustrate this. At dgrin L size, the effect of sharpening is subtle. In prints, it would be dramatic. The "Believe" picture is over sharpened for the sake of illustration. Here the difference is dramatic, even at this small size. A print of the sharpened version has visible halos that are very unattractive and distracting.
Take heart, though, there is a simple 9 step procedure that produces good results for many shots. I'll outline the steps first and go through in detail with illustrations.
The Simple 9 Step Procedure
- Work in the LAB color space. If the image is not already in LAB mode, use Image->Mode->LAB to get it there. Select the L channel by clicking on it and then click the box to the left of the composite LAB channel in order to make all the channels visible at once.
- Work with 100% magnification. Select some important part of your image, eyes and hair for example. If you care more about how your picture will look posted on the web, work at lower magnification. If you care more about very large prints work at higher magnification. Dan taught me that 100% was a good compromise, and I have found this to be true.
- Bring up the USM dialog box with Filters->Sharpen->Unsharp Mask.
- Set the "Amount" slider to it's highest setting, 500.
- ]Set the "Radius" slider to 5. The slider actually goes much higher, but trust me, this is a very high setting.
- Tune the "Threshold" slider so that noise isn't being sharpened. With the slider at 0, you will see lots of ugly noise in areas that should be solid. Increase the threshold until only features that you actually want sharpened are affected. I often find that values between 10 and 30 work well. (Use the "preview" check box in this step and future steps to compare the unsharpened image with your current parameters.)
- Tune the "Radius" parameter so that the halos are not so large as to obscure fine detail. Large halos can extend into neighboring areas and make a real mess. The correct values for this parameter are very dependent on the resolution of the image. For 8MP images, I find the right value is often somewhere between 1 and 3.
- Tune the "Amount" parameter until the image actually looks good at 100%. This means turning it down until the halos are not quite visible but their effect is. Use the "preview" check box often here to compare with the original. The sharpened image should look sharper, but the halos should not be obvious. You may need to iterate a few times between steps 7. and 8. to fine tune a bit more.
- Apply the filter and zoom to fit the image to your screen. Use undo/redo to compare the image before and after.
Now, I'll walk though the steps in more detail with illustrations.
Theory: Sharpening the L channel only prevents it from introducing colored halos and restricts it to lightening and darkening the colors that are already there. Here is a crop from the same part of the "Believe" shot, this time sharpened all the channels of RGB. See how USM has added some red in the blue halos? This is because it works on each channel individually and sometimes the interactions produce these color shifts. (Exactly why is left as homework for the aspiring color theorist.) I'll paraphrase Dan Margulis here. Unless you actually want to introduce unexpected color shift during sharpening, and you shouldn't, sharpen only the L channel.
Here is the USM dialog box after steps 4 and 4.
Steps 4 and 5 set up USM to extreme parameters. The idea behind this is to make the effects of sharpening painfully obvious. This will allow you easily to see what is going on.
We are at step 6 of our recipe, tuning the threshold value in the USM dialog. Threshold controls how large a transition is required between light and dark before sharpening notices it and works on it. Increase the threshold amount and subtle transitions are ignored in favor of more distinct ones. In this case, we can see how USM can introduce a lot of noise if it doesn't ignore the small transitions. So turn up the threshold amount just until the last of the unwanted noise is quited. In this case, this happened with threshold set to 20. Important thing to notice: Larger threshold amount values are more conservative and result in less sharpening. A threshold value of 0 leads to very aggresive sharpening and will very often make noise much worse. Even supposed experts are often confused about this.
We are now at step 7, ready to tune the Radius amount. This controls how wide the halos are. The image above uses a radius value of 4.3, clearly too much. The light halos are very large, large enough to obscure detail in the driver's face and the pattern of cracks on the window and on the window wiper, among other places. The black halos in the chain clearly overlap the light halos from the other sides of the links. So turn down the radius amount until the halos are small enough to make the image look sharper instead of more blurry. Here, I arrived at a value of 1.7.
We can still see the halos, but they no longer overpower the detail. Unlike the choice of threshold amount, there is some judgment involved in this step. With experience, it will come more naturally. For now, make liberal use of the preview check box to compare with the unsharpened image. Be a little conservative. Remember, sharpening is a magic trick. The goal is to create the maximum illusion without being detected. But if the mechanisms behind the trick are visible, the illusion is ruined.
Now we have arrived at step 8, and it is time to finish making the image actually look good by tuning the amount parameter. This controls how light the light halos are and how dark the dark halos are. At the end of step 7, the halos are still clearly visible, and the illusion is still unrealistic. Turn down the amount until the halos are no longer obvious but the illusion still works.
I found this point with amount set to 220. If you look very hard (or magnify more), can still see the halos. But mostly compared to the original, this just looks sharper compared to the original. Once we step back to look at the entire image, we can judge our success a little better (see the comparison at the top.)
Here is the USM dialog with the final settings for this image.
This tutorial started life as a dgrin post in April of 2005, as part of a Digital Darkroom Assignment on sharpening. The original post and many subsequent posts with questions and answers is located here. If you still have questions or comments after scanning that thread, please post to that thread and they are sure to get timely responses.