AECbytes Tips and Tricks Issue
#23 (October 24, 2007)
Expanding Dynamic Range in Photoshop
Book & Video Author
The human eye is an amazing instrument—the light we perceive on a bright sunny day is on the order of a billion times brighter than the faintest starlight we can just make out on a moonless night. Compared to what we see with our eyes, cameras, computer monitors and printed media offer a very narrow dynamic range. Most digital devices are only able to capture or display their brightest whites about a thousand times more brightly than their blackest blacks.
While our eyes need time to adjust (for example, when we emerge from a movie theater on a sunny afternoon) to perceive the large dynamic range that we do, we are usually pleased by images or prints that show an expanded dynamic range—all at once. While it's not as good as seeing a real scene with our own eyes, images with an expanded dynamic range are a closer approximation to our perceived reality.
Professional photographers often bracket important shots—taking several exposures at different f-stops or shutter speeds to ensure they have captured the proper exposure (slice of dynamic range), at least in one image. The technique I want to show you in this article is how to combine two exposures, such as the ones shown below, into one expanded dynamic range image. This trick is not to be confused with creating a true high dynamic range (HDR) data set—a subject I plan to cover in a future article.
I recommend bracketing by changing shutter speed rather than f-stop for the simple reason that changing the f-stop alters the depth of field (area in sharp focus). Not all point-and-shoot digital cameras have the ability to alter shutter speed, so you might have to use a higher-end model or prosumer (professional-consumer) camera to effectively bracket.
The key to this technique centers on some unusual masking tricks in Photoshop. Although the masking can be done in any version of Photoshop that has layer masks (going way back), one of the optional tricks discussed below requires Photoshop CS3. I'm working here with two bracketed shots of the same space (see image below); one image exposed with a slower shutter speed to capture the interior, and the other exposed a little faster to capture the world outside the windows.
Using the Move tool, drag both layers into one document—hold down Shift while you drag to register the two images. Option-double click (PC: Alt-double click) the Background layer to convert it into a regular layer. Drag the darker layer on top of the brighter layer in the Layers panel. If you hand held the two shots and you are using Photoshop CS3, Shift-select both layers and choose Edit > Auto-Align Layers. This will analyze the content of the images and perfectly line them up. Right click on the auto-generated layer masks and choose Apply Layer Mask to merge the masks into their corresponding layers. Crop the document slightly if necessary to get rid of any areas that aren't covered by both images. If you are using an older version of Photoshop, I recommend using a tripod to avoid alignment problems between your bracketed shots.
The Dark layer is exposed to capture the world outside the windows. We will use a layer mask on the top layer to reveal the layer underneath. Target the Dark layer and click the Add Layer Mask button at the bottom of the Layers panel.
By default, the new layer mask will be white, meaning it's not hiding anything. Black pixels on the mask hide the layer, and grayscale pixels obscure more the closer they are to black.
You might think, no problem, I'll just paint on the mask and that will be that. Well, it's usually never that easy unless you have very sharp differentiation between light and dark areas. In this example, the mask we need would be extremely difficult to paint because of the translucency of the drapery and the complexity of the dark leaves in front of a bright window.
So rather than manually paint the complex mask, we'll take a more procedural approach to the problem. Target the Bright layer, select all by pressing Command-A (PC:Ctrl-A), and copy the bright image to the clipboard by pressing Command-C (PC:Ctrl-C).
Display the content of the Dark layer mask in the document window by Option-clicking (PC: Alt-clicking) the mask thumbnail—not the layer thumbnail. If you do this correctly the document will turn white. Paste the contents of the clipboard into the mask by pressing Command-V (PC:Ctrl-V). Photoshop will automatically convert the bright color image into a grayscale mask, as shown below.
To see how this mask is working, Option-click (PC: Alt-click) the mask thumbnail. It looks pretty awful at first, but we'll improve it. The problem is, the mask is way too sharp and specific right now. Display the mask again and then choose Filter > Blur > Gaussian Blur. Give the mask an extreme blur so you lose all detail. A radius of about 40 pixels should do it. Click OK. Option-click (PC: Alt-click) the mask thumbnail again to show the result, which should look much better now.
The mask isn't perfect, but we can tune it up with Levels. Make sure the Dark layer mask is still selected and invoke Levels—press Command-L (PC:Ctrl-L). Make more of the darkest areas black by dragging the shadow input slider to the right. Make the entire mask darker by dragging the right output slider to the left as shown below. The amount that you drag the sliders depends on the images you're working with. You can see what's happening to the image as you adjust the mask in real time, so drag the Levels dialog box out of the way if necessary. Experiment with the sliders in the Levels dialog box and click OK to apply the changes. It is least destructive to apply levels only once to the layer mask.
Display the mask again to appreciate what Levels did for you—Option-click (PC: Alt-click) the mask thumbnail. The darkest areas are soft black blobs that hide the dark layer and the brightest areas are slightly gray because we also needed to tone down the brightness outside the windows.
Option-click (PC: Alt-click) the mask thumbnail for the last time to show the final result. Through creative masking techniques, we have successfully merged the highlights from the dark image into the shadow detail present in the bright image. The resulting image (see below) has an increased dynamic range compared to the original bracketed images—and now we can see out the windows.
About the Author
Scott Onstott is a book and video author of
AEC software tutorials. He has a degree in architecture
from UC Berkeley and has served as an instructor
there, in addition to working in several prominent
engineering, architecture, and interiors firms
in San Francisco. He has also worked as a technical
editor and technology consultant.
Scott has contributed to over two dozen books
and videos on AutoCAD, Architectural Desktop,
VIZ Render, Revit, 3ds Max, VIZ, Photoshop, Illustrator,
Painter, Fireworks, and Dreamweaver. He most recently
with Lynn Allen. He can be reached via: www.ScottOnstott.com.
If you found this article useful and have not
yet subscribed to AECbytes, please consider
doing so. Subscription
is free, and more subscribers will allow this
publication to provide more of such content
Tricks >Expanding Dynamic Range in Photoshop >