What is focus stacking? How does it work? And how can you use focus stacking for beautiful, tack-sharp images?
In this article, I explain everything you need to know about focus stacking, including:
- What the technique offers for photographers
- When you should use focus stacking in your photos (and when you should avoid it)
- The simple, step-by-step process to stack your images
By the time you’re done reading, you’ll be able to stack landscape photos, macro photos, and much more.
Let’s dive right in, starting with the basics:
What is focus stacking?
Focus stacking is a technique designed to achieve a deep depth of field by blending (or stacking) several images together. Each stacked shot is focused in a different spot, so the combined depth of field is deeper than the depth of field produced by any of the individual images.
Feeling confused? Don’t be. While the concepts may sound tricky, the basic process is very simple:
- You take several images of a scene, making sure to focus on each part (i.e., the foreground, the middleground, and the background).
- You blend the images to achieve a final file that features a sharp foreground, a sharp middleground, and a sharp background.
Note that focusing stacking doesn’t require fancy equipment, either; you can focus stack with a standard camera (even a smartphone camera, in fact), though I do recommend you work with a tripod and a manual focus lens if you can, as I discuss in a moment.
When should you focus stack your photos?
Focus stacking is designed to overcome the limits of depth of field.
In other words, focus stacking is only necessary if you’re faced with a scene that can’t be well handled by your camera setup’s current depth of field capabilities.
Now, if you’re familiar with camera optics, you’ll know that the depth of field is affected by three key factors:
- Lens focal length
- Distance to the subject
- Lens aperture
So as you zoom your lens, move closer to your subject, or widen your lens aperture, the amount of the scene that’s in focus will decrease. On the other hand, as you widen your lens, move away from your subject, or narrow your lens aperture, the amount of the scene that’s in focus will increase.
In most situations, you can handle your depth of field requirements without focus stacking. If you’re faced by a sweeping landscape, you can choose a wide-angle lens and you can narrow your aperture; that way, you can capture the entire scene in focus using a deep depth of field. And if you’re faced by a standard close-up subject such as a flower, you can back up slightly from your subject and narrow your aperture to get your desirable depth of field.
But in a few situations, you won’t be able to achieve a deep enough depth of field to keep the entire shot sharp (from the nearest foreground element to the most distant background element).
Specifically, you’ll run into depth of field problems when working with:
- Very deep landscape scenes
- Ultra-close macro subjects
- Deep building interiors
Your depth of field just won’t be deep enough, and only parts of the shot will turn out sharp (while other parts will turn blurry).
Of course, you can always try to back up or use a wider lens, but that isn’t always feasible (especially if you’ve already chosen your composition). And you can narrow your aperture, but at a certain point, you’ll start to run into optical problems caused by diffraction.
In such cases, you have two options:
You can take a single shot with a shallower depth of field and try to make the effect work. (Shallow depth of field shots can look beautiful when done carefully!)
Or you can focus stack.
How to focus stack: step by step
As I’ve explained above, focus stacking is pretty easy to do, and you can focus stack with a smartphone camera and nothing else.
That said, I do recommend you invest in a few basic items:
- A tripod, which will keep your composition consistent as you capture a series of images
- An interchangeable-lens camera and a lens capable of focusing manually
- Photoshop (or another form of focus-stacking software)
Let’s take a look at how the stacking process works, from shooting in the field to blending the images on the computer:
Step 1: Pick your subject, choose a composition, and set your exposure
Focus stacking starts by locking down a subject and a composition.
Mount your camera on a tripod and carefully compose your photo. If you don’t have a tripod, you can do handheld focus stacking, but you’ll need to maintain the composition as carefully as possible.
(Quick aside: You’ll struggle to focus stack scenes that feature moving subjects, which is part of the reason why portrait photographers, wildlife photographers, and street photographers rarely use this technique. Pick a scene that will remain steady for the few minutes it takes to set up your shot.)
Next, set your camera to Manual mode, then dial in an exposure. You should use the camera’s exposure meter and histogram to guide you, and note that the exposure will remain fixed across all focus-stacked shots. Once you’ve set your exposure, you should not change it, or else you’ll need to do extra work standardizing the exposures when blending your shots later. (For the same reason, I’d also recommend you select a white balance preset and dial it in. It doesn’t need to be perfect – you can always make changes in post-processing – but if you can keep the white balance consistent, it’ll make your job much easier down the line.)
And by the way: Before you proceed with the rest of the focus-stacking steps, make sure that your scene actually requires focus stacking. If you’re using a wide-angle lens, you can probably shoot most landscape scenes at f/16 or so and get an image that’s sharp throughout. It’s only when you add in close foreground objects – thus increasing scene depth – that focus stacking becomes essential.
Not sure whether focus stacking is necessary? Take a test shot with your lens focused about one-third of the way into the scene, then review it on your camera LCD. Zoom in and check both the foreground and background. If everything turned out sharp, then you’re good to go – but if parts of the shot are blurry, then you’ll need to proceed with the focus stacking technique.
Step 2: Switch your lens to manual focus and take your first shot
Set your lens to manual focus. (There’s usually a little AF/MF switch on the barrel.)
Then manual focus on the nearest part of the scene, such as the sand in the foreground (if you’re shooting a seascape) or the tip of the flower petal (if you’re shooting a close-up).
(If you’re using a camera that doesn’t offer manual focus, then you can autofocus on the nearest part of the scene. Just make sure that you get the autofocus point exactly where you want it.)
Take the first shot, making sure your exposure and composition remain locked in place.
Step 3: Take your remaining images
At this point, you simply need to take a series of images while slowly moving the focus away from the foreground. Adjust the focus, take a shot, adjust again, take another shot, and so on, until you’ve captured a sharp version of every part of the scene.
How many images do you need? That really depends on your scene/subject. Most focus-stacked landscapes require just two or three shots (one for the foreground and one for the background, or one each for the foreground, middleground, and background). The exception is if the foreground is unusually close to your lens or you’re using a telephoto focal length, in which case you may need four, five, or more images.
Macro focus stacking, on the other hand, is more time consuming. You’ll often need to shoot 8+ images (and sometimes upwards of 20, especially if you’re working at 1:1 magnifications or beyond). The image on the left is a single shot, but the image on the right is a 12-image focus stack:
(If you’re looking to get into serious macro focus stacking, I’d recommend you invest in a focus rail, which will help you adjust your point of focus more precisely.)
Over time, you’ll get a sense of how many shots are required for a focus-stacked scene, but when in doubt, take too many images, not too few. You can always discard similar shots later, but if you fail to capture enough shots, you’ll end up with a bad final result.
Step 4: Blend the images in post-processing
Blending a handful of files might sound difficult, but it’s actually pretty easy; various programs, including Photoshop, automate the process. The instructions below reference Photoshop, but you can get similar (or better) results with a program like Helicon Focus.
First, add your focus-stacking series to your hard drive. Open Photoshop, then select File>Scripts>Load Files into Stack:
A Load Layers window will appear; click Browse, then select your files:
Check the Attempt to Automatically Align Source Images box in the Load Layers window. Then hit OK.
Take a look at the Layers palette. You should see all of your files listed as separate layers. Select every layer, then go to Edit>Auto-Blend Layers.
Make sure to check the Stack Images option, and be sure to check the Seamless Tones and Colors checkbox:
Finally, click OK.
After a few moments of processing, you’ll see your final stacked image appear. You may notice issues along the edges, which you can simply crop away.
Finally, select Layer>Flatten Image, and you’re done! You can now edit the photo like any other file.
Before you export a stacked image, zoom in to 100% and check over the details. Occasionally, the software will struggle to blend the files, which will result in a few strange artifacts. You can remove these pretty easily with the Healing Brush, but if you don’t check, you may end up exporting an imperfect shot.
Focus stacking in photography: final words
Focus stacking is an amazing technique, and now that you’ve finished this article, you know how to achieve a great result with nothing more than a camera and a bit of Photoshop wizardry.
So go have some focus-stacking fun. Capture a deep landscape or a beautiful macro, then do the blending in Photoshop.
Now over to you:
What do you plan to focus stack? Have you tried focus stacking before? Share your thoughts (and focus-stacked images!) in the comments below.