Focus stacking – Extending Depth of Field

Focus stacking – Increasing Depth of Field

Unripe red currants show the final result of focus stacking
A macro image of unripe red currants stacked from 15 images using Zerene Stacker

(This post contains affiliate links to If you buy from them through these links I may receive a commision)

As a photographer, have you ever come across situations where the depth of field (front-to-back sharpness) in a photo is not nearly as deep as you want it to be?

I have, and I still do all the time.

Sometimes you just have to compromise, and accept the fact that this is all your combination of lens and camera body can do at a certain aperture.

How much depth of field that you’ll be able to achieve in the first place depends on a few different things like camera sensor size, lens focal length and aperture.

Other times you can, with some preparation and planning, get as much depth of field (DOF) as you like with the help of a technique known as focus stacking.

Before moving into the topic of focus stacking, it’s good to know a bit about the relationship between sensor size, lens focal length and aperture first, and you can get more information about them here:

Sensor size

Focus, aperture, focal length and depth of field

This article going forward will be focused on how to expand the depth of field by the means of focus stacking.

Which type of photographic genre is best combined with focus stacking?

I would say any technique or style that involves a sturdy a tripod, and little to no movement in the frame.

Some movement can be handled in certain situations but it would definitely be a more difficult process.

Action photography is usually out of the question for focus stacking.

Macro Photography

Macro image of forget-me-nots illustrating a narrow depth of field
Macro photography by its nature produces a very narrow depth of field. This photo of forget-me-not flowers was taken at f/11, and you can see only a tiny bit of the image is sharp.
Focus stacking can help extend this.

The kind of photography in which focus stacking is mostly used is macro photography.

If you read about DOF (depth of field) that I linked to earlier in this post, you would know that in macro photography the DOF is very narrow by nature (short distance to subject and usually medium to tele focal lengths are used).

This technique will give you full control over what is sharp and what isn’t, for example, you can get a subject in your image sharp from front to back while preserving the bokeh (the soft unsharp portion of the image) behind it.

This is why you can open up a new world when combining focus stacking with macro photography.

Landscape Photography

You can also combine focus stacking with landscape photography, and a normal or wide-angle lens.

Why a wide-angle lens you say. After all, photos taken with these lenses may even seem sharp taken at close to open apertures.

Well, to ensure front-to-back sharpness in your landscape shots that have a lot of depth to them, you may have to stop down your lens quite a bit.

In addition (depending on the lens), as you stop down to a smaller aperture, you may run into a little problem called lens diffraction.

This problem can actually make your photos a little less sharp beyond a certain f-stop.

You can read more about this problem here and here.

This is where focus stacking could be the solution.

You can then use the sharpest f-stop of your lens (usually around f/8 for most lenses), take for example 3 separate photos of foreground, middle and background and stack them together utilizing the sharpest possible f-stop of your lens.

Using focus stacking this way for landscape shots may seem a little over the top to some, but if you are a sharpness freak like me you may often find a use for it.

Now let’s move on to the things you need….


What kind of equipment is needed for focus stacking?

  1. A camera and lens (capable of focusing manually) on a sturdy tripod. That’s the minimum.

Browse some gear here at

Cameras (DSLRs)

DSLR Lenses


You can buy a few accessories that will help make the picture taking a bit easier though.

  1. A focus rail (aka macro slider or rail) may or may not be a good idea.

Here is a general guide of when to use a focus rail or when just to use the focus ring on your lens. There are advantages/disadvantages to both methods depending on the subject you are shooting.

Browse some focus rails here at

  1. A remote shutter release of some sort, preferably a wireless type. If you find choosing the right remote hard check out my article on how to choose a shutter release/remote control. It is a good idea to keep touching your camera to a minimum between shots.
  2. Focus stacking software. You can use Adobe Photoshop, or some dedicated stacking software like Zerene Stacker or Helicon Focus

So now, you have the gear; let’s see how it’s done…..

Planning and shooting the series of photos for your focus stack

You may have understood by now that focus stacking is not a quick thing.

It requires some planning and there are quite a few steps through the process, which makes it a bit time consuming, but the rewards can be fulfilling so hang in there.

Planning and shooting a macro focus stack

First, you have to determine how “deep” you want your depth of field. This is the distance from the start of the sharp area at the front of the subject to the end of the sharp area at the back.

It’s usually a good idea to start by taking a few test-shots to see how much of the desired sharpness area the chosen f-stop will cover.

This may give you an indication of how many shots you will need. It depends a bit on the subject. Sometimes it’s a bit hard to see.

The test shooting is also good for determining the correct exposure.

I recommend using your camera in manual exposure mode as exposure consistency between frames is crucial to prevent trouble when stacking the images in your software later.

Also, be sure to check how you frame your composition and make your framing a tad bit wider than you normally would. The reason for this is that when the software does the stacking it will align the images and shift the edges slightly, sometimes making a blurred edge around your final image. This is normal and is just something you crop out.

The order you shoot the photo series in really doesn’t matter, but I feel the most natural way is to shoot from front to back.

I usually start the first shot a bit in front of the main subject to make sure I cover the entire area.

Then you can start shooting and move the focus ring or the macro slider a bit between each shot.

If you are moving the focus ring, make sure to keep a close eye on the focus in the viewfinder, or on the live view screen, to make sure you don’t move the ring too much between shots. I prefer to use the live view screen on my Pentax cameras.

An example of unsuccessful focus stacking, showing an image of a fish (Perch).
This image of a fish out of water (Perch) may look ok at first sight, but it’s an example of unsuccessful focus stacking. Take a look at the cropped outtake below.



Unsuccessful focus stacking as it shows variations in focus blur across the image
This photo shows the fish scales up close and you can see the focus stacking is unsuccessful, varying from sharp to focus-blur across the image. This is the result of moving the focus ring too much between shots and not capturing enough images.

If you use a focus rail, make sure that you move it in small enough increments between each shot.

Either way, make sure that the in-focus areas (the sharp parts of the photos) overlap a tiny bit between the shots.

If the sharp in-focus areas don’t overlap properly, or at least connect, you can get some artifacts or weird out-of-focus spots when the software does the focus stacking.

In addition to using a wireless shutter release, utilize your camera’s self-timer or mirror up function (if you use live view the mirror is already up) to ensure that all vibrations die down before taking the next picture.

Keep shooting until you have covered the entire area you want sharp.

The 15 unripe-red-currant images with different focus that make up the final stacked image at the top of the article.
These 15 images make up the final image at the top of this article.

Experiment and practice with this technique until you get the results you want.

Remember, it’s always wise to take more pictures than you need if possible.

It’s easier to discard a few images from a stack than to have a hole in it.

Planning and shooting a landscape focus stack

This is much easier than the macro stacking.

You need less images and you don’t have to be as painstakingly accurate.

The initial depth of field you are working with here is much greater and in many cases, you’re only looking to stretch it just a bit.

Alternatively, maybe you would like to add a foreground element close to the camera in your sweeping landscape shots and still have full front to back sharpness.

An image of a waterfall with great front-to-back sharpness illustrating the concept of focus stacking
This is a landscape image of a waterfall stacked from 4 different images. Front to back sharpness is much greater than what could have been achieved with just a small aperture.
See further down the page how this stack was done.


An image of a waterfall illustrating the slight lack of sharpness without the benefits of focus stacking.
This is a single image taken at aperture f/16 with the focus set to the hyperfocal distance.
It’s not that much different from the stacked image (apart from the lack of a polarizer effect), but if you look closely at the fine details, this one is a little more dull.
That’s because the focus- stacked image has the benefit from using the lens at its sweet spot aperture (f/8).


Technically, the process is the same as with the macro focus stacking.

Check how much depth of field you would get at your set aperture by either taking some test shots or by using your camera’s DOF preview function. This will give you an idea of how much you will have to move the focus ring.

Start shooting from one end and work your way through by adjusting the focus ring between shots.

Depending on the lens and the main subjects, you may only need 2-4 photos to get a full front-to-back depth of field.

Blending the images using stacking software

So now, you have taken your series of photographs and you are sure you have enough images to cover the area you want sharp.

Now is the time to blend them all together to make the final (stacked) photo.

In my workflow, I always bring the photos into Adobe Lightroom first, as this is my primary editing tool. I do the general sharpness/contrast adjustments, which are always needed as I shoot in RAW format (read more about shooting in RAW here). I may also do some other touch-ups if needed.

Just make sure that any editing you do (especially if it’s exposure related) is synced across all the images in the series using Lightroom’s sync function. This will ensure that you don’t get any weird exposure variations or other artifacts in your final image.

Don’t do any cropping though. Leave that until after the stacking process.

For the focus stacking, you can use Adobe Photoshop or some special software dedicated to the task like Zerene Stacker or Helicon Focus.

I have used Adobe Photoshop in the past with decent results. I have recently been trying out Zerene Stacker and I feel this software does a better job (especially with a bit tricky stacks), with less manual work, than Photoshop does.

All the example photos regarding focus stacking in this post were stacked using a trial version of Zerene Stacker.

Example: What was my workflow when stacking the waterfall image?

  • I started by importing all the images into Adobe Lightroom.
  • I adjusted the contrast a bit using the basic sliders as I always do with all images. I did a minor white balance adjustment.
  • Then I made sure to synchronize these settings to all the images in the stack (see screenshot), so that they all look the same with respect to exposure.
Adobe Lightroom sync settings screenshot
This screenshot shows Adobe Lightroom in Library mode. Highlight all the images starting with the one you want to sync from. Click Sync Settings (yellow ring in screenshot). In this example, I checked all the settings and clicked Synchronize.

I used a trial version of Zerene Stacker for this focus-stacking job and the trial contains access to ALL the functionality of the software including a Lightroom plugin.
Functionality may differ depending on the software license you have bought as some licenses have certain limits.

  • I selected all the images in the series and exported them to Zerene Stacker using the plugin (see screenshot). The default export format of the plugin is 16-bit Tiff files in whatever color space you have set as default in Lightroom.

adobe lightroom export to zerene stacker menu screenshot

  • In the Zerene Stacker menu, I selected Stack—>Align & Stack All (Both). This tells the software to stack the images using two different algorithms.
    Going into these in depth would make this article go on forever, but you can read about how to use the program here. I also had to use the retouch function of the software on the water in the   image.
    As the water was moving and therefore was different in each shot, it looked very weird when stacked automatically. The retouch function allows you to decide manually, with the help of a brush, which portion of any one image you want to emphasize (a bit like working with layers in Photoshop).
zerene stacker retouching screenshot
This screenshot shows the Zerene Stacker retouching windows where you can use the brush to tell the software which parts of the images should “shine through” in the focus stack.
  • After I was done with the retouching, I went to File—>Save output image on the menu. It saved the image in the same folder as the original files in Lightroom. This way, all I needed to do was to go back into Lightroom, go to Library—>Synchronize folder on the menu. Then there’s a prompt to import 1 new file. Accept this and the final stacked image is imported back into Lightroom.
  • I did some final sharpening of the image and then I was done.


This has been a lengthy article about focus stacking, but if you liked it please share it with your friends or discuss the topic in the comment section below.

You want to ensure you don’t miss any new articles on this blog?

Enter your email adress to subscribe to this blog and receive notifications of new posts by email.


Leave a Reply