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

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


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.

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.

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

Now we go to the gradient tool.

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.




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.