If you find the resources helpful, please consider a donation or the purchase of a print from one of the galleries. Your support will help keep the resources in the Digital Darkroom free to all.
 


Making An Edge Mask

Last week's "Tip of the Week" described the benefit of using a surface mask when removing noise. The easiest way to make a surface mask is to take an edge mask for sharpening and invert it. So, how do you create an edge mask?

I use my TLR Sharpening Toolkit. You can, too. It includes an action for creating a luminosity edge mask and another for creating an enhanced edge mask. Third-party sharpening tools typically use a luminosity edge mask to keep sharpening confined to edges. This reduces the sharpening of noise.

(The enhanced edge mask in the TLR Sharpening Toolkit is a luminosity mask plus a color mask. Luminosity masks find edges in an image based on difference in luminosity. Color masks find edges based on differences in color. By combining both, edges that might otherwise go undetected by a luminosity mask are added to the mask. The trade-off is processing time. Generating an enhanced mask for a large image, like a scanned negative or a 1Ds MkII image, can take considerable time.)

The downloadable version of The TLR Sharpening Toolkit automatically walks through the steps for building an edge mask. All of the Capture Sharpening actions use an edge mask. For more control over the generation of the edge mask, you can edit the steps in the Luminosity Edge Mask action so they stop and wait for user input.

The steps here will help you build your own luminosity edge mask *AND* help you build a better edge mask with the TLR Sharpening Toolkit.

The image below is an unsharpened image from Rome, Italy. With a two- or three-round sharpening technique, capture sharpening should be gentle (just enough to restore sharpeness lost during digital capture), stay away from any extreme highlights or shadows (using Blend If sliders), and use an edge mask to keep the sharpening away from surfaces (where sharpening artifacts are more likely to be noticed). The Capture Sharpening actions in the TLR Sharpening Toolkit handle all three details. The best results come from adjusting the parameters for the edge mask as it generates.

Step One: Create a New Layer. If you have no layers except the Background layer or your uppermost layer is a pixel layer, you can duplicate it. Otherwise you will need to create a merged layer. On the PC, you press alt+ctrl+shift+n+e (on the Mac, it's opt+cmd+shift+n+e).

Step Two: Apply the Find Edges Filter. You will find it under Filter | Stylize | Find Edges. Apply it to your new layer. The result looks like a tenuous, washed-out, multi-colored sketch.

Step Three: Invert. A quick shortcut is ctrl+i on the PC (cmd+i on the Mac). Otherwise Image | Adjustments | Invert.

Step Four: Desaturate. Quick and easy via Image | Adjustments | Desaturate.

So far, there's been no need for manual intervention. None of the first four steps has any parameters. They just run and do their task. The next several tasks can benefit from some manual adjustment. The defaults in the TLR Sharpening Toolkit work well enough for many images, but you can craft a better mask in just a few moments.

An edge mask should not look like a sharp sketch. Narrow edges translate into sharp transitions between sharpened and unsharpened image features. Smooth transitions are better, unless you like visible sharpening artifacts. So, instead of narrow and tenuous think pudgy and soft. That's what we're working towards with the next several steps.

Step Five: Levels. We want to sharpen the edges, not the surfaces. The sky is clear, so we will not wind up sharpening noise there. To build up contrast initially between the edges we intend to sharpen and other image features, we use Image | Adjustment | Levels.

Step 6: Maximum. We have our edges. Now we need to pudge them up. We even need to get a bit carried away with the bloat. That way, when we apply some Gaussian Blur later, we'll have smooth transitions along our puffed edges. I settled on a Radius of 1 pixel for Filter | Other | Maximum, although I was tempted to use a Radius of 2.

Step Seven: Median. The Maximum filter left the image a bit blocky. Plenty of squares sprinkled around the image. Filter | Noise | Median smooths out the rough edges and pixellation. A Radius of 2 pixels brought some pixels out of the background but also smoothed the edges.

Step Eight: Threshold. The edges are now approaching ooey and gooey. Finer details are blending together. This is evident in the roof of the building and along its lower edge. Image | Adjustments | Threshold will take us further down that road, increasing contrast.

Step Nine: Gaussian Blur. We bring back detail, only to give some of it up by bluring the mask. A bright mask with sharp, high contrast edges make for harsh transitions. This is the last transformation for the mask. We want soft, smooth, puffy edges in the mask. We don't want to completely obliterate the details in the mask, but we do want to soften them quite a bit. Filter | Blur | Gaussian Blur is the tool we need. 3.5 pixels does nicely here.

It's not a mask yet! The result is a layer that can be converted into an alpha channel. Making it into an alpha channel is easy enough. Start by selecting the entire layer with ctrl+a (cmd+a on the Mac). Copy it to the clipboard. Ctrl+c or Edit | Copy, whichever you prefer. Then go to the Channels palette and create a new alpha channel. Then paste your new mask into the new channel. Ctrl+v or Edit | Paste. To save space, you can go back and delete the layer you used to create the mask.

I decided to use USM sharpening. You'll find it under Filter | Sharpen | Unsharp Mask.

Here is a Print Size crop before sharpening . . .

. . . and the same crop after sharpening.

With a small Web image, the difference is not striking. Viewed at the intended size, the second image is sharper. Yet, it is free from any visible sharpening artifacts. A second round of sharpening, after the adjustments to tone and color are complete, will bring out more detail.

I hope this "Tip of the Week" helps with your sharpening. Look for more sharpening tips in the coming weeks.

Cheers!

 







image