SLR CameraPoint and Shoot Camera
shaded top background

Sharpening page 2


Table of contents

Right, here goes!

First you need to make two duplicate images. One of them will be used for the edge finding process, whilst the second will be for creating the new channel, making the selection, and sharpening the result. By making two duplicates you avoid doing any work on your original, so no matter how badly you mess up (but you won't mess up, of course!) you can easily start again with no harm done. In the GIMP, duplicates are made by simply right-clicking in the image, and choosing Image:Duplicate from the context menu. (All menu choices are in bold and sub-menu choices are separated by colons throughout the tutorial.) So do this twice.

In one of the duplicates, go to Filters:Edge-Detect:Edge.... In the dialog that opens, set the amount to 6.0 as in the screenshot below:

GIMP edge detection dialog

Make sure the other settings are as shown, but these are the default values anyway. Click OK, and in the resulting image choose Image:Mode:Grayscale. Next, choose Tools:Color Tools:Levels... and a dialog like this will open:

GIMP levels dialog

As in the screenshot, bring the left hand slider (the black point) across to the right so that it is on the right hand side of the clump of histogram that will be on the left, and bring the right hand slider (the white point) to the left about a quarter of the way. The purpose of this step is to make the black bits very black and the white bits very white. Click OK.

Next, choose Filters:Blur:Gaussian Blur.... A dialog box like the one below will open. Adjust your settings to match the screenshot, and then click OK.

GIMP gaussian blur dialog

Finally, choose Tools:Color Tools:Levels... again, and this time simply pull the right hand slider to the left so the the white point is set at a luminosity of around 200. It's not critical. Click OK, and after all this you should be left with an image like the one below:

Mask for subsequent sharpening

All the parts of this image that are white are the edges that have been found, and these parts of your image will be sharpened when the unsharp mask is applied. The black areas will not be sharpened because they contain no edges. What you have created here is an example of a selection mask. Selection masks are two tone images in pure black and pure white that can be pasted into a new channel which is then converted into a selection. The white areas are selected, and the black are not. I use this technique in many different circumstances, and it's an automated alternative to the "magic wand" or other hand selection tools. Let's go and convert this selection mask into an actual selection.

So now turn to your second duplicate image. First, we will create the new channel in this image. To do this, click on the new channel button (second from left) at the bottom of the layers/channels dialog shown below:

Layers/channels dialog

Just click OK in the dialog that appears next. Go back to the other image which now contains the black and white mask, and choose Edit:Copy. Return to the image with the new channel, and ensuring that the new channel (and not an image layer) is active, choose Edit:Paste. In the layers/channels dialog, click on the layers tab, and then click on the little anchor sign to fix the floating selection. Select the channels tab again, and if all is well you will find that a tiny thumbnail of the mask is now visible in the new channel as shown in the dialog below:

Layers/channels dialog

Click on the eye symbol next to your new channel to turn off its visibility, and then click on the channel to selection button which is the little reddish button second from the right. You will immediately see "marching ants" indicating that a selection has been made. Now click on the layers tab, and create a duplicate layer, so that the actual sharpening will be in a separate layer enabling you to flip easily between sharpened and unsharpened versions.

Choose Filters:Enhance:Unsharp Mask... and in the dialog box that opens use the values 0.5 in radius, 0.5 in amount, and 0 in threshold, just as is shown in the screenshot of this dialog in the theory section of this article. Click OK. It is considered that several (2 or 3) passes of the unsharp mask at weak values such as this is better than one pass at stronger values. To do this simply bring up the unsharp mask dialog again, check the settings, and click OK. Repeat this process for each pass of the filter. To be honest I think you'd be hard pressed to see a lot of difference between a single strong pass and several weak passes, but the advantage of the multi pass method is that you can gradually build up the sharpening, looking after each pass to see whether undesirable artifacts are starting to creep in. It is vital that you check the results of sharpening at 100% enlargement. The second screenshot below shows the result after running the unsharp mask three times, which is probably once too often for this subject, but it makes the sharpening more obvious for the purpose of this demonstration.

The result!

First, a 100% enlargement of a section of this image, before sharpening was undertaken:


Section before sharpening


And finally (at last, you might think) the same section after applying this technique:

Section after sharpening


I think you can clearly see that apparent sharpness has increased. There are some additional artifacts in these images because to save space I have increased the JPEG compression ratio by saving at 70%. As explained above, I have also slightly over-sharpened to make the distinction clearer, and as a result there is a slight halo effect best viewed where the little protuberances on the small turret-like structure are seen against the sky. Note however that in the blue sky and the shadow area under the pitch of the roof there has been no sharpening and thus no exaggeration of any noise that might be present. These areas are unsharpened because the edge detection process did not select them.

Obviously all this is a lot more trouble than simply applying the unsharp mask to the whole image, and doing one strong pass rather than several weaker ones. As in my previous article, only you can know whether your images are worth it!

Some final thoughts

Knowing how much sharpening to apply is largely a matter of trial and error as you build up your experience. However, the following points are worth bearing in mind:

  • Sharpening should always be the last adjustment you apply to an image. In the example I've been using, I adjusted the contrast, lightened the darkest shadows, and corrected the converging verticals before going through the sharpening process described here.
  • Sharpening should be related to the end product. For a small 6"x4" print sharpening can be more drastic than for a large 24"x16" print. The larger the final product, the more any sharpening artifacts will show up. Fortunately, larger prints are also usually viewed from a greater distance, so a little sharpening will go a long way.
  • Always save an unsharpened version of your image after all your other adjustments have been made, so that you can then apply different degrees of sharpening to copies of the image destined for different purposes.


About the author

Steve Brown lives and works in London, and has moved from film to digital over the last two years. His main photographic interests are architecture and the French countryside. More of his images can be seen in his TLF gallery (http://www.thelensflare.com/profile.php/sgbrown) and on www.hautevienne.moonfruit.com.

shaded bottom background
spacer