Stack Your Focus

By Roger (30 Jan 2014)

While I have Mark's light tent set up, let's talk about making some close-up, or macro, photographs.

Just so you know, the technical definition of macro photography is one in which the size of the subject on the sensor is life size or greater. Most people today use the term to mean any photograph at a very close range, whether a macro lens is used or not. I wouldn't nitpick a close-up that isn't really macro, but you should know the correct meaning.

Besides the obvious attraction of photographing very small slices of life, many photographers love the very shallow depth of field inherent with macro photography. Depending on your lens' focal length and selected aperture, the acceptable area of focus can be as small as a couple of millimeters. You can use this to drive the viewers eye to your subject; the rest of the photo will be lost in bokeh.

With a macro lens, even a weed can look nice.

With a macro lens, even a weed can look nice.

But when you want to have everything in focus, you'll have to resort to a post-processing technique called focus stacking. This technique is nothing fancy, but you'll need a photo-editing software, like Photoshop, to make it work.

I start by stealing my wife's sculpture of Neu Schwanstein and putting it inside the light tent. The light tent helps give me nice even lighting. You can see the castle is about eight inches from front to rear.


When I focus on the front gate with my Nikon 105mm Micro lens, set at f8, you can see that only about half an inch is in focus. The front of the sculpture is way too soft, and the back is completely lost in the bokeh.

With a macro lens, your depth of field will be very narrow.

With a macro lens, your depth of field will be very narrow.

To keep everything consistent, I put the camera on a tripod and use manual mode on both the camera and lens. In any of the auto modes, the camera will calculate its settings every time you depress the button and may give you different solutions each time. That isn't what you want. You can use the camera's first solution as your starting point for exposure. Just read the back of your camera; switch to manual; and dial in the settings.

With your lens in manual, you will make a series of photos, moving the focus through the subject a fraction at a time. I usually do this from front to rear and then rear to front. Make sure you rack through the entire range. You may want to turn on Live View, so you can track your progress on the rear LCD. It is easier to see the minute differences in focus on each photo when you're looking at the LCD.. Now, import the photos into Lightroom; make any adjustments you want to the first image; and synchronize those settings across all your photos. Consistency, remember?

Getting the photos into Photoshop, is easy. Highlight all your images in the series; right-click on them; and choose “Open as Layers in Photoshop.” It may take some time, depending on the file size and number of images, but you'll get one Photoshop file, with each of your images on a separate layer.

Highlight every layer and choose “Edit>Auto-Align Layers.” Even with the camera on a tripod, you may have had some movement. Next, (with all layers still selected) choose “Edit>Auto-Blend Layers>Stack Images.” Make sure you check the box that says “Seamless Tones and Colors.” Photoshop will create masks for each layer, revealing only the portions that are in sharp focus. Something like this.

Photoshop will create the complex masks.  You don't want to try this manually.

Photoshop will create the complex masks.  You don't want to try this manually.

From here, I flatten the image and make any touch-ups I want and save the image.  You don't have to flatten the image if you're a stickler for non-destructive editing, but your final file size is going to be ridiculously large. Voila! You have the entire subject in focus. I threw in a background color that I took from the image, so there was a little less white and cropped it.

Final image, composed of stacked layers.

Final image, composed of stacked layers.

Like the compositing I showed last week, this is not a very complex technique and can yield a photo that isn't possible with one photograph. Take your time and get all the different focus points before you move the camera. This one took 20 images and still isn't perfect when you zoom in to 300%. If this was more than just a demonstration, I would do another round. Have fun.

Artificial Focus

In a lot of the advertising out today people are shooting what is known as selective focus.  Parts of the image are crisp and clear while other parts are very, very soft. There are a whole lot of ways to accomplish this.  The reasonably priced LensBaby ® system gives you the ability to shape the focus in camera, while traditional and very expensive Tilt-shift lenses can correct for planar distortion. At Photoshop World an instructor passed on his wisdom that it is far easier to shoot the originals as sharply as possible and add the effects afterwards.  You can’t make blurry photos sharper…yet. One of the tools in the next release of Photoshop is a much improved set of filters you can test out as part of the CS6 Beta

However, there are some plug-ins which really work well right now.  I use OnOne Software’s Perfect Photo Suite 6.1, but Nik Software and Dfine also make good tools.

The specific tool in the suite is called Focal Point.  You can control just about everything about the blur and it creates it as a separate layer.  It works from inside both Lightroom and Photoshop.  You can also run it as a stand-alone application.  You overlay a grid for what you want to keep in focus.  You can adjust the shape, the density of the blur among other choices.  Here are two examples.  I started with this pirate figure and applied a nice circular blur.

A very popular commercial technique makes things in an image appear to be miniature models.  This replicates what you can accomplish with that tilt-shift.  It basically keeps a narrow band in the middle of the image in focus and blurs both the fore and background.  It starts with a rectangular or planar blur instead of the oval from the previous image.

These are just some of the ways you can add creative impact to your pictures as you process them.