Here’s a dilemma that frequently confronts photographers: how do you get everything in a photo tack sharp. What if there are interesting rocks and pebbles a foot or so from your camera and dramatic mountains miles away. This situation calls for a technique called focus stacking.
That’s not the only time you’d want to use it. Imagine using your macro lens to photograph a flower or insect and wanting the whole thing sharp. A macro field of focus is so narrow that only a small amount of the subject is sharp. Here, too, this technique comes to the rescue.
So, what is focus stacking, this magic solution to these sharpness dilemmas? In a nutshell, you take multiple shots of the same scene, with each shot focused at a point progressively farther into the scene, and blend the shots together in post processing. Easy, right?
Well, yes, but it does require some preparation and a lot of care.
If you try to use a small aperture, like f22, you’d get enough depth of field for the photo to look reasonably sharp. But the nearest and farthest objects would be a little blurred. You simply can’t get 100% of a landscape or macro photo sharp in a single shot unless you’re using an expensive tilt-shift lens. But digital cameras and post processing software now offer us alternatives, like focus stacking.
Compose Your Image and Set Up Your Camera on a Tripod
You see a beautiful scene, whether a giant landscape or a tiny subject, and figure out your composition. What is the story here and how can you frame this scene to tell it? Note that not every photo needs front-to-back sharpness. There’s a place for blur and a place for selective focus.
But let’s assume that you want front-to-back sharpness. Once you’ve figured out how you want to shoot this scene, break out the tripod and set up the shot. Though it is possible to do focus stacking shooting hand-held, it is not easy. It’s better to use a tripod, which gives you stability and locks down your camera, so that the series of images you take will all line up when you blend them together.
Give yourself a little extra room around the edges of your shot to account for any focus breathing. The angle of view will change slightly from shot to shot as your focus point moves through the image. Shooting a little wider gives you a bit of insurance that you won’t have to crop out anything important once all of the images are lined up.
Choose Your Exposure and Focus
Once your camera is locked down on your tripod, dial in the camera settings. Because you’re focus stacking, you can use the sharpest aperture for your lens. If f11 or f8 is your sharpest aperture, use it. You don’t have to use f22 and lose sharpness in a vain attempt to get limitless depth of field.
Now choose the rest of your settings. What kind of shutter speed do you need? A short exposure to freeze motion in the wind-blown grass at your feet? A long exposure to show motion in the clouds streaking overhead? Do you need to adjust your ISO to allow you to use the shutter speed you want? These creative decisions can make as much of a difference in your final image as will the sharpness of focus stacking.
Beware that not all scenes are good candidates for focus stacking. A still desert landscape works nicely. A scene with a lot of movement will not. A field of sunflowers with a slight breeze will create all kinds of problems for the processing software. Unless it’s still, anything with a lot of complicated details at a lot of different distances can be problematic, too.
You might also like: The Ultimate Beginner’s Guide to Landscape Photography
Take Multiple Photos Adjusting the Focus Each Time
Some newer cameras, like the Nikon D850, will do this for you, taking all the necessary photos with one press of a button. Assuming your camera doesn’t, how can you shoot for focus stacking?
I recommend using Live View and focusing with your screen, rather than trying to do it with your viewfinder or the depth of field markings on your lens.
I start my focus stack by placing my focus point on the part of the scene that’s closest to me, typically at the very bottom of the Live View screen. I’ll auto focus there, then zoom in on the screen to check that the focus is spot on. After all, if your images are out of focus, stacking won’t help. I choose a focus point where there is a good amount of contrast, to make precise focusing easier. Click.
Next, I’ll move the focus point a little bit farther into the scene, looking for an area with good contrast that’s just a little bit further from my camera. Check focus. Click.
I’ll repeat these steps until my focus point is at the farthest point, like the mountains in this example, which will be the last shot in my stack. Click.
Depending on how complex and detailed the scene in front of me is, the focus stack can contain anywhere from 4 to 20 or even 30 shots. You want the sharp area of each photo to overlap the sharp areas in the images before and after it. Taking more photos than you think you’ll need is better than underestimating. On a macro shot of an insect or flower, where each shot has only a tiny depth of field, you might wind up with 50 or more shots.
Blend Your Images in Photoshop (or your favorite editing software)
I use Lightroom and Photoshop, but the process should be similar in other applications. Many photographers swear by focus stacking applications like Helicon Focus and Zerene Stacker.
Once you’re at your computer and have your images in Lightroom or your favorite application, it’s time to prepare them for focus stacking. I first try to make sure the light is relatively even across all the images. This can be a problem when shooting in rapidly changing light at a sunset, particularly if the dark shadows are moving quickly across your scene and the highlights are changing. In this case, the light was pretty stable.
Next, I’ll select all of the images in a stack and go Photo -> Edit In -> Open as Layers in Photoshop.
Once they’re all in Photoshop, I’ll select all the layers and go Edit -> Auto-Align Layers. I find that the Auto Projection works well and don’t bother with Vignette Removal or Geometric Distortion. Click on OK.
Once everything is aligned, I’ll go Edit -> Auto-Blend Layers. Select Stacked Images and check Seamless Tones and Colors. I have not had great success with letting Content Aware Fill Transparent Areas, so I leave that unchecked and hit OK.
Then the magic happens and Photoshop selects the areas that are sharp in each layer and masks out the less sharp areas. I’ll Merge Visible Layers (CMD/CTRL + SHIFT + OPTION/ALT + E) to combine all the sharp areas into a new layer and see how it all comes out. At this point, I always need to zoom way in and check all the edges. I’ll often find blurry or transparent areas (caused by focus breathing) and will need to crop in to eliminate them.
Once you’ve done it a couple of times, you’ll find that focus stacking is a relatively easy and painless way to get an image with front-to-back sharpness. It lets you use the sharpest apertures of your lens and gives you a lot of flexibility on the settings you choose. But it’s not always necessary. You may want to use selective focus to draw attention to one area of your photo, like the pistils of a flower in a macro shot, or a stunning formation in a landscape shot. You might also find that having a bit of blur in the immediate foreground helps lead the eye into the frame.
So, use it judiciously but, when you need it, focus stacking is a great tool.
Have you ever used this technique? Leave your comments below!
Frank Gallagher is a photographer and writer from Washington, DC. He built up his photography business after a career in nonprofits during which he developed extensive experience in visual storytelling. He enjoys sharing his love of photography with others.