Sharpening Techniques

Most Photoshop users are familiar with unsharp mask.  Although the name sounds as if your photo will become less sharp, this filter actually improves edge detail.  Unsharp mask got its name from the dark room.  The process involved sandwiching a blurred copy of the original with the original photo in the enlarger.  The exposed image was sharper than the original (see also Contrast Masking).  Photoshop (or Corel Photo Paint, Paintshop Pro, etc.) use the unsharp mask filter to simulate this process.  With this filter, you have control over three variables.  Threshold, which tells the program how much of a difference between nearby pixels should be considered an edge in need of enhancing (low numbers produce the greatest effect).  Radius, which indicates the distance from each pixel to look for an edge, and amount, which adjusts the degree of sharpening you wish to apply.  The sharpening algorithm decreases the brightness in dark areas within the chosen threshold and radius, and increases the brightness of the light areas.  The effect is to increase contrast only at the edges; thereby, making the edges appear sharper.  Over sharpening will produce unattractive light halos around dark areas, and dark halos around light areas, although we are more sensitive to the light halo effect.  To achieve noticeable sharpening, however, you must choose a low threshold, which means that any noise reproduced from the film scan or the digital camera will be treated as an edge and enhanced. 

So how can we minimize the effect of sharpening noise?  Lets work on the photo of the Puffin.  The method I use involves creating a mask with only the areas in need of sharpening exposed.  The technique I am about to describe takes advantage of the Find Edges filter or effect.  This filter searches for abrupt changes in tonality and creates a dark line around the edges, like a pencil sketch.  I will present the method in Photoshop and in Photo Paint.  In Photoshop, open the image that you want to enhance, then convert the image to Lab color (Image/Mode/Lab color).  This will allow you to work on the lightness channel without affecting colors.  Now create a new channel from the channels palette.  This new channel will eventually become a mask.  Next, select the Lightness channel.  Choose Select in the menu bar and click All.  Copy the image to the clipboard. 

Now comes the magic.  Select the new channel, and paste the image from the clipboard.  Click on Filter from the menu bar and select Stylize and Find Edges (see figure on the right).  You should see an outline of the regions containing edges.  While you could accept this image, I usually like to improve the contrast.  Select Image from the menu bar then click on Adjust and Levels.  Adjust the input slide levers (the triangles just below the histogram).  First, pull down the highlights until the grey in the background just disappears.  Don't worry about getting all of the grey out at the expense of the detail in the edges.  You can always paint out the grey later.  Now move the shadows slider up until you get sharp, black lines at the edges.  To smooth out the transition, select Filter from the Menu bar and Blur followed by Gaussian Blur.  Select a small number (3-5 is usually good, I used 3 in this example) and click OK.  If you notice some dark areas that you do not want to be sharpened, paint them out with white (airbrush is fine here).  At this point, I usually use the Levels Adjust to bring back the black.  Move the shadows slider up to restore black (see figure on the left). 

Now lets make a mask or marquee.  Choose Select from the menu bar and click on Load Selection... (be certain that the new channel was selected and that the name of the original file is in the Document window and the name of your mask layer is in the Channel window).  Check the box labeled Invert to select the black outline.  Black is the protected area so we invert to make the white area protected.  You should now see the marquee (a moving series of dashes or marching ants).  Click on the lab channel in the channels palette, and view the image with the marquee visible.  If you still see areas that were incorrectly selected, you can remove them by selecting the Lasso tool and while holding down the ALT key, draw around the parts that you want to remove.  The ALT key allows you to remove selections, while the SHIFT key allows you to add selections.  Once you are satisfied, Click View on the menu bar and select Show,  Selection Edges.  This will hide the marquee so that you can see the effect more easily.  Make sure that you are on the Lab channel (the original, color, unsharpened image).  From the Filter dropdown menu, select Sharpen and Unsharp Mask.  Start with the smallest threshold (0) and a radius of 1.  Increase the amount until you are satisfied.  Click OK.  Check your work by switching between Undo and Redo (hold down the CONTROL key and press Z to toggle between the last two operations).  Select Mode from the Image menu and reselect RGB, 24 bit color.  Below are the images of the original (left), the effect of a generalized unsharp mask (center), and the effect of the new technique (right).  Notice how the noise in the photo was enhanced in the image in the center.  For this example, I used 300% for the Amount in both sharpened images, admittedly an aggressive sharpening amount.

Now for Corel Photo Paint.  Open the image and switch to Lab color (Image/Mode/Lab Color).  Select the Lightness channel.  Select Mask from the Menu and Select All.  Copy the Lightness channel to the clipboard.  Create a new Channel From the Channel Docker, and give it a name (if you don't give it a name, a name will be assigned so don't worry if you miss this step).  Make sure the new channel is selected.  Select Edit from the Menu and Paste as New Selection.  Click on Effects from the Menu and select Contour and Find Edges.  Click on the Solid radio button, and adjust the level until you see black lines were the edges of the image should be.  (Selecting solid eliminates the grey and the necessity to adjust the Levels as in Photoshop.)  To smooth the effect, click on Effects on the menu bar and select Blur/Gaussian Blur.  As above, set a low value (3-5).  Here as above, you may want to readjust the levels.  Be aware that the name was changed in Photo Paint 10 to Contrast Enhancement.  It is the same as Levels in Photo Paint 9 and below.  Even though the new name is indicative of the function, I wish they had not changed the name.  Now click on Mask in the Menu and select Load and the name of the channel containing your mask, creating a mask from your edge channel.  Click Mask on the Menu bar and select Invert.  Select the Lab channel.  From the Menu bar, click on Mask and deselect Marquee Visible.  Click on Effects and select Sharpen and Unsharp Mask.  Adjust the variables as described in the Photoshop section until you are satisfied with the results.  Control-Z will undo and Ctrl-Shift-Z will redo the effect.  Now you can convert the Mode back to RGB, 24 bit color.

This technique is most effective when you have a solid background or an out of focus background that should not have sharpening applied.  If your photo has a lot of detail (foliage, grass, etc), the difference between this technique and simply applying unsharp mask to the whole image is less visible.

Another simple technique to sharpen an image involves the high pass filter.  The high pass filter recognizes abrupt changes in tonality and ignores regions in which changes are more gradual.  Much like a high pass filter in electronics.  The filter works around neutral, middle grey.  That is, if there is little change, the image will be middle grey.  If the change abruptly turns dark, the filter will create a dark region, and if the abrupt change is to a lighter tone, the filter creates a lighter region.

So, how can we use this to sharpen a picture?  First open the image and duplicate the layer (Layer, Duplicate).  In Photo Paint, the only difference is that Layers are called Objects (select Object, Duplicate).  Now, I like to remove the color.  Select Image, Adjust, Desaturate.  Select Filter, Other, High Pass (in Photo Paint, select Effects, Sharpen, High Pass).  Use a small radius (1-3 will do, I used 3 for this example).  Notice the grey image with dark and light edges (see figure on the right).  Now go to the layers palette (Objects Docker in Photo Paint) And choose Overlay from the blending mode.  To reduce the effect, choose a smaller number for the % Opacity.  That's all there is to it.  The photo below (center) is the result.  The original is on the left.  Notice that the noise was again enhanced with this technique.  If you have the patience, select the blur tool from the tools palette.  Choose a large brush size and make the opacity 100%.  (In Photo Paint, open the Paint Tool and select Effects Tool, then choose Blend from the tool bar at the top.)  Go back to the High Pass image, and start blurring the noise in the background and foreground (neutral grey regions), carefully avoiding the edges.  The latest version of Corel Photo Paint and Adobe Photoshop have introduced Smart Blur.  This filter selectively blurs the low frequency data (the speckled appearance in the High Pass photo to the right), making this task much easier.  For this image, I would use a radius and amount of 10.  This will improve the signal to noise ratio (below right). 

Some people will use the Emboss filter instead of the High Pass filter to create a grey image with edges before blending with Overlay.  Consider trying several methods to sharpen images, and choose the one that best enhances your photo.