Capturing images that are tack-sharp from the immediate foreground to the distant background becomes nearly impossible when using ultra-wide-angle lenses. Especially if you’re positioning your lens near the foreground element.

We know that the best aperture for landscape photography is between f/7.1 and f/13. This is the go-to range for most landscape photographers, but when using extreme wide-angle compositions, it’s quite likely you’ll return home to find half the images out of focus. Unfortunately, this happens way too often. Even a narrow aperture such as f/22 won’t give you the perfect front-to-back sharpness.

That doesn’t mean that it’s impossible, though. 

The solution is called focus stacking, a technique that results in razor-sharp images. It’s used by photographers of all levels, and with a little basic understanding of photography and post-processing, it’s not as difficult as one may think.

In this ultimate focus stacking guide, you’ll learn how to use this popular technique to create sharp photos. You’ll learn how to easily implement it into both your in-field and post-processing workflow.

What is Focus Stacking?

Simply put, focus stacking is an intermediate technique that makes it possible to create images that are sharp from the very front and all the way to the back, no matter the distance between the closest foreground and background.

Guide to Focus Stacking
Focus Stacking was essential to get a sharp image due to the wide-angle lens and distance between the immediate foreground and background.

The technique requires the use of both a camera and post-processing software such as Adobe Photoshop or Helicon Focus.

Focus stacking is used within many genres of photography, but it’s perhaps most commonly used in landscape and macro photography. While there are photographers who use it for portrait and wildlife photography as well, it’s less common (and a lot more difficult) to use when photographing moving subjects.

We’ll come back to the exact step-by-step guide to focus stacking in a bit, but the main idea of the technique is to capture two or more images with different focal points, i.e., one image that focuses on the foreground and another that focuses on the background.

These images are then imported into a photo editor and blended/merged together. Only the sharpest areas from each image are used in this blend, which results in the image having a sharp foreground, middle ground, and background.

I know it sounds confusing at first, but after you’ve gone through the step-by-step process and tried it for yourself, you’ll see that it’s not as hard as it sounds.

Why Do You Need to Focus Stack?

Many photographers tend to avoid learning intermediate or advanced techniques because they don’t want to put in the extra effort or feel like their images are ‘good enough’. The truth is that learning a slightly more advanced technique, such as focus stacking, has a lot of advantages, making it well worth spending a little extra time in-field and in post-processing.

As already mentioned, it’s nearly impossible to get front-to-back sharpness when using an ultra-wide-angle lens and a foreground subject only a few centimeters/inches away.

When there’s a big distance between the immediate foreground and distant background, only parts of the image will be sharp, even at a narrow aperture.

Take the image below as an example. When I focused on the nearest flower with an aperture of f/10, the next flowers were already out of focus. This is due to the flower only being a few centimeters away from the lens.

Guide to Focus Stacking
Notice that the further away from the first flower, the more out of focus the image is

To overcome that issue, I needed to capture a total of 4 images with different focus points throughout the frame. The final is sharp all the way from the first flower to the background mountain.

Macro photography is another example of when focus stacking is an essential technique. Getting the entire flower sharp in one shot is near impossible; try zooming in on the flower and you’ll quickly see that there are many parts slightly out of focus. This is common when using open apertures such as f2.8 or f5.6. Therefore, many tend to capture multiple images and blend them together for one ultra-sharp image.

The differences might not be significant if you’re only viewing your images on a smartphone or small device, but as soon as you start printing, the difference becomes alarmingly visible, especially when printing large.

When Should You Use Focus Stacking?

While focus stacking is a powerful technique you need to learn, it’s not always necessary. In fact, it’s most likely not needed for the majority of your images.

There are only a few scenarios when focus stacking is essential:

  • photographing a scene with a great distance between the foreground and background
  • using an ultra-wide-angle lens with a subject close to it
  • zooming in on a scene, such as a forest, and you want everything to be sharp, even with an open aperture
  • photographing small scenes and macro photography in general

Focus stacking will benefit each of these scenarios in order to get the optimal sharpness throughout the scene.

Guide to Focus Stacking in Landscape Photography
To get front-to-back sharpness, I needed to take one image focusing on the foreground and one on the background.

If you’re not sure whether a scene needs to be focus-stacked or not, I recommend setting up the image as you normally would, taking a test shot, and zooming in on the image preview. If there are areas that lack sharpness, that’s a good indication that focus stacking should be used.

How To Focus Stack for Sharper Images

All of this sounds fine and dandy, but how does it actually work? What do you need to do in order to get razor-sharp images?

The good news is that it’s not nearly as difficult as you might fear. You’re already halfway there if you know how to change the focus of your camera. If you’re also familiar with blending multiple exposures for better dynamic range, this will be a piece of cake.

Those who are new to Adobe Photoshop might find this a little more confusing, but trust me, it won’t be long until you master focus stacking (and so much more!). I do, however, recommend that you read our article about Layers and Masks in Photoshop before attempting to follow the next steps.

Step #1: Capture Multiple Images In the Field

Now that we know what focus stacking is, why you should use it, and when it is beneficial, let’s look at how it’s done.

As mentioned, this is a two-step technique where the first step takes place in the field.

To make the next steps easier to follow, I recommend that you start exploring this technique using an ultra-wide-angle lens such as the Nikon 14-24mm or similar focal lengths.

While it’s not essential, it’s going to be a lot easier to perform this technique using a tripod as it ensures that the camera doesn’t move between images. This is important when we follow the focus stacking post-processing technique.

Now, set up the image like you normally would and find a good composition that has a distance between foreground and background. I recommend using an aperture between f/5.6 and f/8, but this might depend on the specific situation. Adjust the ISO and Shutter Speed according to normal practices learned from the Exposure Triangle.

Adjust the Focus and Capture the Images

When you’ve prepared your composition and settings, you need to adjust the focus point. This can be done by using either Auto Focus or Manual Focus (or a combination of both)

Start by focusing on the subject closest to your lens and make sure that the nearest foreground is sharp. Take an image, then adjust the focus point to be slightly further away, for example, at the middle ground. Take another image before moving the focus point even further away.

Focus Stacking
Image 1: Focus on the rock Image 2: Focus on the background

Repeat this until you’ve captured enough images to get everything in focus.

Exactly how many images you need depends on the individual image. In most cases, two or three images are sufficient, but sometimes twice as many shots might be needed to get the entire image sharp.

If you’re unsure how many images you need to capture, simply look at those you’ve already got and check that you’ve got enough images to get everything sharp if they were to be combined.

Take a couple of extra images if you’re still unsure. Just in case.

That’s it! The first part of this technique isn’t that difficult, and after doing it a couple of times, you’ll start recognizing how many shots a specific scene requires.

Let’s quickly recap how to focus stack:

  1. Set up your shot like normal
  2. Use a tripod for more accurate results (and less work in post-processing)
  3. Focus on the object closest to the lens and take an image
  4. Adjust the focus to be further away (how much depends on the distance between the foreground and background) and take another shot
  5. Repeat step number 4 until you’ve got enough images to make the entire image sharp.

Step #2: Merging the Images in Post-Processing

After capturing the series of images in the field, it’s time to head back to the computer and blend them together.

There are many ways to do this, but I’m going to introduce you to two of the best methods (both in terms of accuracy and difficulty). The first technique takes place in Adobe Photoshop, while Helicon Focus is used for the second.

Alternative 1: Blending Images in Adobe Photoshop

Adobe Photoshop is the most used software for advanced image processing, and experienced users can achieve endless techniques and effects to enhance their images. Many landscape photographers, myself included, consider this to be an essential tool.

As mentioned, there are many ways to achieve similar results, but the following is the Photoshop focus stacking technique I find to work best. This method makes use of both the Photoshop algorithm and manual masking techniques.

Let’s take a quick look before diving in a little deeper.

Opening images as Layers in Photoshop from Lightroom

Focus Stacking in Adobe Photoshop Step-by-Step:

  1. Open the series of images as layers in Photoshop (If you use Lightroom, select all images and choose Edit in… -> Open as Layers in Photoshop)
  2. Selected all layers and go to Edit -> Auto-Align Layers
  3. Duplicate all layers (Select all layers and click Cmd/Ctrl + J)
  4. Select only the duplicate images and go to Edit -> Auto Blend Layers. Select Stacking Images and check the box for Seamless Tones and Colors.
  5. The Photoshop algorithm now analyzes each individual pixel and selects only the sharpest ones from each image by revealing or concealing them through Layer Masks.
  6. When the masks are created, zoom in on the image to see if every area is sharp.
  7. Create a Stamp Visible Layer (Cmd+Shift+Option+E on Mac or Ctrl+Shift+Alt+E on Windows) with a white Layer Mask and move the original layer that is sharp in the now soft area beneath it. Use a black brush on the mask to paint the sharp parts back.
focus stacking in photoshop
Select “Stack Images”

It got a little confusing there at the end, right? In most cases, you don’t need to use step 7, but, unfortunately, Photoshop doesn’t always do a perfect job. So, let’s take a closer look at what just happened:

The first step after opening the images as layers in Photoshop is to align them. Even if you use a tripod, there will be small movements between the images, often caused by the change in focus. If you haven’t used a tripod, the differences might be bigger and more difficult to align.

Align images in Photoshop

In the third step, we create a duplicate of all the layers. We’ll need the second set of images in case the Photoshop algorithm does a poor job.

After creating the duplicates, we select them and automatically blend them together using the Auto Blend Layers function. This will do a good job in most scenarios, but for some of the more complex blends, it makes some mistakes. That’s when we need to step in and correct it manually.

Layers in Photoshop for Focus Stacking

You should always zoom in to 100% and look through the image for any soft spots caused by the algorithm. When you’ve done this and located any errors, create a Stamp Visible Layer on top of all other layers.

The next process can be a little tedious if there are many mistakes, but it’s one that’s important to complete with a certain degree of accuracy. Let’s say that there’s a soft spot somewhere in the foreground. You’ll then need to locate the original layer (one that doesn’t have a Layer Mask from the blend) and drag it to be directly beneath the top Stamp Visible layer.

Stamp Visible in Photoshop

Next, create a white Layer Mask on the Stamp Visible layer and paint over the soft area with a soft black brush at a high opacity. This reveals the layer beneath and introduces its sharpness back into the damaged area.

If there are multiple areas with errors, you’ll need to repeat this process for each of them (i.e., create a new Stamp Visible Layer, place it on top, and place the sharp layer beneath it). Keep in mind that you can use the same foreground layer for other damaged areas in the foreground too, as long as that’s the sharpest layer for that given area.

Alternative 2: Blending Images with Helicon Focus

Helicon Focus is another trusted software that many photographers use for focus stacking. In fact, as the name might imply, it’s a software built for that exact purpose.

German landscape photographer Felix Inden is one of many who regularly uses Helicon for images that are too complex for Photoshop to handle. Luckily, he says, blending stacks of images with different focal points into one tack-sharp image is very easy in Helicon Focus.

Focus Stacking Helicon Focus
Importing files in Helicon Focus Pro

Step 1 is to import the files and choose one of three different stacking approaches. Explaining exactly what the different algorithms/approaches do gets a little too technical. That’s why Helicon advises testing all three and selecting the one that works best for the given image. Approach A and B seem to work best for my own landscape photography.

Focus Stacking rendering helicon focus
Rendering in Helicon Focus

You can see the mask building up while Helicon is rendering the files, which is quite fun to follow since each algorithm creates a different one. The rendering process is incredibly fast compared to Photoshop, even when using big amounts of images for macro photography or product shots.

focus stacking helicon focus
Check that everything went well

Make sure to zoom in once the rendering is done and make sure that it did a good job. The file is now ready to be exported and processed in Adobe Photoshop or your software of choice!

focus stacking helicon focus
Image is ready for further processing!

There are many different software that can be used for focus stacking, but Adobe Photoshop and Helicon Focus are the go-to products for many. Another high-quality software is Zerene Stacker, which many claim performs even better than the others.

Conclusion

Focus stacking is an intermediate technique that takes place both in the field and in post-processing. It can seem quite complex in the beginning, but it’s a technique that’s essential to understand if you want razor-sharp images.

It’s simply not possible to get a proper front-to-back sharpness when using ultra-wide-angle lenses and the more ‘extreme’ approaches to compositions that have become so popular in today’s world of landscape photography.

Focus stacking isn’t a technique that needs to be applied for each and every photo, but it’s important to understand when it’s going to be beneficial.