Beloved elfin inhabitants of santaDeke’s workshop, you guys have been so patient with us during the rift in the space-time-blog continuum that was caused by Photoshop Channels and Masks One-on-One (the book is that powerful). Although the book won’t be here in time to fill your holiday wishes, I thought I’d give you an early treat. One that might even help you make treats for others on your gift-giving list. There’s a great exercise in the new book about using an edge mask to sharpen an old photograph. Here’s a restored version of an old photograph of my grandparents out for a drive in a borrowed car in Vicksburg, Mississippi circa 1932. (Isn’t it awesome they wore their “riding clothes” to go for a ride in the car?)
If you think it makes my swarthy, outdoor-loving (and incredibly cool, seriously) forebears look this good, wait ‘till you see how awesome it works for Deke’s pasty, indoor, serious, studio-lit kinfolk in the following tutorial.
Photographs from the pre-digital age, especially those fifty years or older, tend to contain grain, dust, and scratches. In this example, we’ll work on a 90-year-old photograph that features not only Deke’s maternal grandmother, but a lot of weathering from its 90-year existence that make standard Unsharp Masking out of the question. An edge mask helps you identify the true edges of objects in the image, ruling out the garbage. Creating an edge mask always follows the same basic pattern of steps, which are outlined here for this particular example, but can be altered for your family heirlooms as well.
Step zero: Scan the image if necessary.
Should you scan old photos in grayscale or color? These older photos are usually black-and-white, with maybe just a little sepia thrown in, so the question arises, is there any reason to scan them as RGB? The answer is yes. If you go with a color scan, you may find that the individual channels yield useful information for the restoration process.
Step one: Open an image.
Open Plains dwellers.psd, which is downloadable below if you want to follow along. As I mentioned, this is a family photo that Deke scanned from an old print. Our goal is to enhance the good detail without emphasizing the bad. The woman on the far right (the only one smiling, interestingly enough) is Deke’s maternal grandmother. The years have caused some damage, including dust and scratches—all of which is especially noticeable (and distracting) on the faces of the Dekian ancestors.
Step two: Duplicate the best channel.
We need to identify which channel is the best for our edge mask, and then duplicate that channel:
- Go to the Channels palette.
- Click the thumbnail for the Red, Green, and Blue channels in turn, and identify which one has the best edge detail.
- Because the source is a monochrome image, there isn’t much difference, so we’ll use the “when in doubt” channel, Green. (By the way, for my sepia toned, outside lighting shot at the beginning of this post, the Blue channel worked much better.)
- Drag the thumbnail for the Green channel to the icon at the bottom of the Channels palette to make a copy.
- Double-click the name of the Green Copy channel, type “Edge Mask,” and press Enter or Return.
Step three: Increase the contrast in the Edge Mask channel.
This channel has dust spots and other clutter, so we’ll perform a basic cleanup by increasing the contrast with a Levels adjustment, which is generally speaking always your first step when creating an edge mask:
- Press Ctrl+L (-L) to bring up the Levels dialog box.
- For Input Levels, move the white slider triangle under the histogram to the left to 170.
- This gets rid of much of the pockmark effect in the skin areas.
- Set the black slider triangle to the right to 60.
Click OK to close the dialog box. As you can see, the contrast has been enhanced considerably, helping to clean up some of the garbage in the image.
Step four: Apply the Find Edges filter.
Our next step is to find the edges of the image. Choose Filter > Stylize > Find Edges. That’s it, there’s no dialog box. Photoshop just jumps right in and defines the edges in your image. The alpha channel now clearly defines the edges in the photo, complete with soft edge transitions. But also, as you can see, complete with five-o’clock shadows on everyone, including the children.
Step five: Invert the mask.
We need our edge mask to define the edges, but all the edges are currently black. Press Ctrl+I (Cloverleaf-I) to invert the Edge Mask channel, leaving white where the edges are, thus allowing them to be adjusted without affecting the rest of the image.
Step six: Apply the Maximum filter.
Next we’ll expand the edges in our mask so they cover a larger area along the edge borders in the photo. Choose Filter > Other > Maximum, set the Radius to 2 pixels, and click OK. The filter thickens the edges, as you can see here.
(By the way, if you want to extrapolate this technique to your own family heirlooms, you need to decide the setting for the Maximum filter on a case-by-case basis. After this step, however, the instructions I give you are directly related to the setting you entered here for any similar project.)
Step seven: Apply the Median filter.
The edges, being determined by square pixels after all, are a bit blocky. We can mitigate that square appearance with the Median filter. The Median filter takes neighboring pixels, averages their luminance levels, and—when all is said and done—rounds off sharp corners. Choose Filter > Noise > Median to bring up the Median dialog box. We need to apply the same setting for Median that we did for Maximum, so set the Radius to 2 and click OK.
Step eight: Blur the edges slightly.
The edges of our mask have some transition, but they need more. Choose Filter > Blur > Gaussian Blur (or if you’ve loaded dekeKeys shortcuts, you can press Shift+F7) to bring up the Gaussian Blur dialog box, shown here.
You always want the Gaussian Blur Radius to be 2 times the number of pixels you set during the Maximum/Median stages, so change the Radius to 4 pixels and click OK to apply the blur.
Step nine: Return to the Layers palette.
Now that we’ve built our edge mask, we can sharpen the image with the mask in place to constrain the effects. Press Ctrl+2 (Cloverleaf-2) to return to the RGB composite and switch to the Layers palette.
Step ten: Duplicate the Background layer.
We’re going to use the same sharpening technique we used in the density mask exercise earlier in this lesson. Click the thumbnail for the Background layer to make it active. Then press Ctrl+Alt+J (Cloverleaf-Option-J) to bring up the New Layer dialog box, name the layer “High Pass” (because that’s the filter we’ll apply), and click OK to create a copy of the Background layer.
Step eleven: Apply High Pass sharpening.
Choose Filter > Other > High Pass (or dekeKeys shortcut Shift+F10) to bring up the High Pass dialog box. Set the Radius to 3 pixels and click OK. In the Layers palette, change the blend mode for the High Pass layer to Overlay using the pop-up menu. You can see that at this point the effect is not particularly strong.
Step twelve: Enhance the sharpening effect with Levels.
We’ll enhance the sharpening effect by increasing the contrast with an adjustment layer:
- Alt-click (Option-click) the Levels icon in the Adjustments palette (second from the left in the top row.) If you’re working in CS3, hold down the Alt (Option) key and press the black/white icon at the bottom of the Layers palette, then choose Levels from the pop-up menu.
- In the New Layer dialog box, name the layer “Amount” (because we’re going to adjust the amount of sharpening).
- Turn on the Use Previous Layer to Create Clipping Mask check box so this adjustment layer will affect only the layer directly below (the High Pass layer). Click OK to create the new Levels adjustment layer.
- In the Levels panel, move the black triangle below the histogram to 100 and the white triangle to 155. As you can see we have considerably enhanced the sharpening effect.
Step thirteen: Desaturate the sharpening effect.
The sharpening effect is actually enhancing some of the unwanted color variations in the image, so we need to desaturate the effect:
- Click the thumbnail for the High Pass layer in the Layers palette to make it active.
- Alt-click (Option-click) the Hue/Saturation icon in the Adjustments palette (second from the left in the second row). If you’re working in CS3, hold down the Alt (Option) key and press the black/white icon at the bottom of the Layers palette, then choose Levels from the pop-up menu.
- Set the layer name in the New Layer dialog box to “Desaturate,” and click OK.
- In the Adjustments palette, reduce the Saturation setting to –100 to completely desaturate our High Pass layer. Notice here a faint pinkish glow along the right sides of the subject faces (among other places) is now gone.
Step fourteen: Load the edge mask as a selection.
Now that we’ve created it, we can load the edge mask as a selection. Go to the Channels palette, and Ctrl-click (cloverleaf-click) the thumbnail for the Edge Mask channel to load it as a selection.
Step fifteen: Add a layer mask.
We can now use this selection to constrain the sharpening effect. In the Layers palette, click the thumbnail for the High Pass layer to make it active. Then click the Mask icon at the bottom of the layers palette to add a layer mask to the High Pass layer based on the active selection.
Step sixteen: Make the edge mask active.
Fine-tuning the sharpening effect calls for adjusting our edge mask. Click the layer mask thumbnail (not the image thumbnail) associated with the High Pass layer in the Layers palette to make it active. Hey, at this point, if you’re curious, turn on the USM 35/3/25 layer and see just how much better the edge mask technique worked compared to unsharp mask. Just promise to turn it off again quickly. Shiver.
Step seventeen: Fine-tune the sharpening.
Fine-tune the sharpening effect with a Levels adjustment applied directly to the edge mask:
- Press Ctrl+L (Cloverleaf-L) to bring up the Levels dialog box.
- To minimize the edges included in the edge mask (so fewer areas are sharpened), drag the black triangle under the histogram to the right to about 70.
- To maximize the edges included in the edge mask (so more areas are sharpened), drag the white triangle under the histogram to the left to about 190.
- Click OK to apply your changes and close the Levels dialog box.
Step eighteen: Reduce the sharpening effect.
Reduce the effect by pressing the 7 key to reduce the Opacity setting for the High Pass layer to 70 percent. Here’s the final restored family treasure.
Photoshop Channels and Masks One-on-One should be in stock in early January, just in time for your resolution to become awesomely educated about the intricacies and power of Photoshop masking.