Focus stacking in landscape photography

pink tulips at sunset using focus stacking

Have you ever taken a photo of a landscape with a beautiful foreground, but it was impossible to have both the foreground and the back ground in focus? This is where focus stacking comes in.

What is focus stacking and why do you need it?

Focus stacking is a technique that is often used in both macro and landscape photography. In landscape photography you might find a really good foreground, but it’s so close to your camera that you can’t have both the foreground and the background in focus at the same time. Even if you use the hyper focal distance, this might not work, because the foreground is just too close. This technique allows you to have the entire scene in focus.

Taking the photos

Let’s go through the steps of taking the photos.
Step 1 – Set up your composition with your camera on a tripod.
Step 2 – Focus on the foreground
Step 3 – Select a high f/number – close your aperture to something like f/16 and take your first photo
Step 4 – focus on your middle ground and take another photo
Step 5 – focus on the background and take your last photo

In this example I’ve only taken two photos, but it would have been be better to take more, at least three. In some cases you might need even 5 or 7 photos depending on the scene and on how close you are to your foreground. The closer you are, the more photos you need. In any case it’s better to take an extra photo, then to discover back at home that you took one too little.

Stacking the photos

When you are back home and have imported the photos on your computer you can open them all in Photoshop. Now the focus stacking begins.

Step 1 – Open all photos as layers in Photoshop
Step 2 – Select all layers
Step 3 – Go to: Edit/…Auto-Align Layers --> click Ok
Step 4 – Go to: Edit/…Auto-Blend layers --> now choose: Stack images

Step 3 : Select the Auto-Align Layers… from the Edit menu

Aligning the layers is important, because of focus ‘breathing’. This means that some zoom occurs when changing focus. Aligning the layers will resolve this.

Step 4 : Select the Auto-Blend Layers… from the Edit menu
Select Stack images and click Ok

You can see the result below.Photoshop has created a layer mask for each layer where the sharp/in focus part is shown in white.

After the Blending of the two layers – you can note the two layer masks in the red square

Now Photoshop does not always a good job at putting the sharpest parts together. You will need to check on the edges of the layer masks if there are any discontinuities and edit the masks yourself. This also happened in our example. You can edit a mask by selecting it and and painting it with white if you want to add to the mask and black if you want delete from the mask. With this photo with only two layers it is quite simple, but with more layers this can become complicated.

You can see some of the flowers are shown on the layer where the flowers are not in focus. We can now edit the layer mask to adjust this.

Bonus tip

Another solution is this: After Step 3 (Aligning the layers) we add a layer mask on the top layer.

Add a layer mask on your top layer

Now we go to the gradient tool.

You can find the gradient tool in the menu on the left

Since the top layer in my case is the background, I need to reveal the foreground which is in focus on the bottom layer. To do this I pick a point where to start the gradient and pull down until where I want it to stop. Photoshop shows this as a line. Now let go and you’re done. You now have a sharp photo from your foreground all the way to your background.

Apply the gradient filter on the layer mask

 

The layer mask after applying the gradient tool
The foreground – Before on the left and after on the right
The background – after on the left and before on the right

The advantage of a landscape is that you can often get away with using the gradient tool, which is a lot quicker than having to fine-tune the result of the Auto-Blend Layers result.
With a macro photo I usually start from the Auto-Blend and than patiently adjust the layer masks. This takes some time, but often worth the result.

I hope you now feel confident to try focus stacking. In some cases you can’t do without it and the results are really worth it. If you run into any troubles, just let me know in the comments and I will help you out.

Leave a Reply

Your email address will not be published. Required fields are marked *