Increased Depth Of Field In Photographs With Focus Stacking
Have you ever struggled with having multiple items at various depths in your camera lens and wondering how to keep them all in focus?
There are many times when a landscape photographer has items in the composition that are very close to the camera, while at the same time part of the scene is very far away. The desire is to get it all in focus.
Many years ago, before I was serious about photography and just taking snapshots on family trips, I just worried about getting the main subject in focus and didn’t worry about much else. As long as the kids were in focus, the rest wasn’t really important. If you’re the casual photographer, like I once was, you may be wondering how it’s possible that photos that you see have everything in focus, from the flower in the front to the mountain in the back.
Getting it all in focus
In the below photo of the Somesville footbridge, I had to get everything from the flowers just inches from the camera to the trees in the distance in focus.

Depth Of Field
What we’re talking about here is called the “depth of field” of the camera, which is controlled by the camera settings. The camera controls the aperture, which is the size of the “hole” that lets light into the camera and onto the sensor. This is also referred to as the f-stop. A setting of f/4, a large hole, allows in more light but also has a shallower depth of field. A setting of f/22, a small hole, allows in less light but also has a much deeper depth of field.
Apps like PhotoPills, which are very handy to have on your phone, tell the landscape photographer exactly what the depth of field is for any combination of lenses and apertures. A wider angle lens, like 20mm, has a much deeper depth of field than a telephoto lens, say 100mm.
For example, a 20mm lens shooting at f/8 and focused on an object 3 feet away, will only have the objects from 2 feet away to 6.5 feet away in focus. Well, that isn’t going to work for landscapes. However, changing the camera setting to f/16 will have everything from 1.5 feet away to infinity in focus. Assuming the subject 3 feet away that you were focusing on is the closest subject, the photographer is good to go.
Now let’s move the flower to 1 foot away. Now we have a problem. At f/16, only items from 9 inches to 1.5 feet are in focus. That won’t work. So, we jack up the f-stop to f/22, the maximum of most lenses, to get more depth of field. This places items from 9 inches to 2 feet in focus. Those really close foregrounds, which can look really cool are simply going to be a problem. The desire is the have the mountains in focus too.
In the photo below of Pemaquid Point Lighthouse, the camera was focused on the reflection about 4 feet away, shooting at 19mm and f/11, which put everything from 2 feet (front of the puddle) to infinity in focus. It was one of those rare situations where it all worked out with a single image. I didn’t really need infinity as I wasn’t concerned about the clouds being in perfect focus.

Why Not Use f/22 As Much As Possible?
It certainly can be tempting in situations where it gets the job done. However, there are some drawbacks to doing this. Really small apertures, like f/22, can result in diffraction, which is a loss of sharpness on the edges of the frame. In addition, most lenses are simply at their best for sharpness across the frame at f/5.6 to f/8. Then there’s one other little thing about high f-stops that drives me crazy. The dust spots on the digital sensor show up much worse and have to be dealt with. It’s funny how at f/8 or lower, they just about disappear.
Another issue can be wind moving the plants in your foreground. A small aperture like f/16 is going to result in a really slow shutter speed, the plant is going to be moving all over the place and all of the images will be blurry. A setting of f/16 is going to result in a shutter speed four times slower than f/8, as in 1 second instead of ¼ second. It’s better to have more images in the stack and have them in focus.
In the below image taken at Koosah Falls, the are from the moving water was moving the plant constantly. I had to use a wider aperture and a higher ISO setting to speed up the shutter sufficiently.

Getting the Flower and Mountain in Focus
We have been talking about an issue that affects DSLR and Mirrorless Cameras. Cell phones use a very small sensor, which inherently has a very deep depth of field. It is so deep that newer cell phones have software to remove some of the depth of field and intentionally blur the background. It’s the opposite problem for cell phones.
A Big Issue With The Long Lens
The longer the lens, the shorter the depth of field. It is easy to think that just because you don’t have a close foreground object all will be good. In the below image of Dogwoods among the Pines at Yosemite National Park, I was about 50 feet away shooting at 270mm. This meant that only the objects from 46 feet to 54 feet were in focus. It turned out to be a three-image focus stack.

Focus Stacking to the Rescue
So, getting back to the big cameras, the answer has always been what is called focus stacking. In a nutshell, multiple images are taken each with the focus point being further away resulting in each photo having a different section of the image in focus. These images are then combined together in Photoshop either by manually brushing in the overlays or allowing plugins like Helicon Focus to do the work.
In this image from Arizona’s White Pocket, I was shooting super wide at 14mm, which has great depth of field. I was down low and close to the rock formation. Using an aperture of f/8, only four images were required to get everything in focus.

The Focus Stacking Process
The first task for focus stacking is to take the necessary images. The preferred method is to use a tripod so all of the images will line up easily when combined. If the light is good and the camera is able to use a high shutter speed, It is possible to do it without a tripod.
Years ago, I would just begin the sequence with the focus point in the bottom of the frame, click the shutter, move the focus point up a little, click again, and so on. This worked very well, although it took some time. Another option was to focus on the closest point, click the shutter, rotate the focus ring slightly, click the shutter and repeat until you were sure all was in focus. This is a particularly good method if the camera is down on the ground and you are not able to see through the viewfinder.
Current day cameras, like the Nikon Z7II that I use, have a built-in function that automatically takes all of the necessary photos. It is crazy easy. You just focus on the closest subject in the viewfinder, select Focus Shift (Nikon’s term for stacking), and Start. The camera will even place the stack in a separate folder on your SD card. You do need to remember to focus again if taking multiple stacks.
Now It’s Time to Put Them Together
After loading the stack in Adobe Lightroom, I make basic adjustments to the closest image and then sync those adjustments to the others. Then, I export them to Helicon Focus, which combines them and exports the single combined stacked image back to Lightroom. It’s like magic! At this point, I export the stacked image to Photoshop and make all remaining adjustments.
More Freedom For The Photographer
With focus stacking, I am able to get as close as I want to a foreground subject. I can get within inches if I need to. I can make what is a small foreground object look quite large. Of course, I am hooked on the built-in stacking in the Nikon Z7II.
Focus stacking allows me to do so many different things and expand my portfolio to include scenes that were just not possible without it. If you looking to do some serious landscape photography, it just has to be one of the tools in your toolkit.