Focus Stacking using Helicon Focus
A focus stacking video to accompany this tutorial is also available.
Introduction to Focus Stacking
There are times when the depth of field you can achieve in a single shot just isn’t enough. This is where focus stacking can help.
Trying to achieve a significant depth of field in your images can be quite frustrating. The traditional approach (adopted by most) is to use a very small aperture. You then carefully select the point of focus for maximum depth of field. The drawback with this approach is that as the aperture becomes smaller, something called diffraction sets in and the image sharpness suffers.
Ideally you want to keep your aperture in the range where the lens performs at its best. This is one of the reasons many Landscape Photographers favour large format technical cameras which allow special movements such as tilt. This can be used to increase depth of field beyond what could be achieved with the aperture alone, allowing the aperture to remain within the optimal working range. Unfortunately, most people don’t have one of these cameras, or the patience to use one.
How Much Depth of Field
How much depth of field you need for an image is a bit of a moving target. For some images you might need very little, for example in portrait photography where you throw the background to the subject out of focus. But in other forms of photography such as Landscapes and Macro you might want to maximise the depth of field.
One of the problems we face with these types of photography is that as the point of focus gets nearer to the camera, the depth of field lessens. So if you are shooting a landscape with an object looming large in the foreground, it’s likely that you will focus on the object to ensure it is sharp. Unfortunately, this may limit your depth of field and mean that more distant objects are out of focus. It then becomes necessary to use a much smaller aperture which is probably outside the optimal working range of the lens.
If you are interested in macro photography, the problem is even more acute as the subject is often so close to the camera. Here you can find that even using a very small aperture only gives a few millimetres of depth of field or even less. It can be very difficult to render objects sharp in their entirety.
The solution to the depth of field problem is the technique of focus stacking. This involves taking multiple identical images where only the point of focus changes. The change in focus point is used to move the depth of field over the entire distance that needs to be in focus. These images are then combined into a single image by taking the in focus area from each image and merging these together to give a much greater depth of field.
Shooting Images for Focus Stacking
In order to create an image using focus stacking you are going to need to shoot at least two identical images where only the point of focus changes. In the example used for this tutorial we will use a set of two image; one where the focus is on the foreground and in the other the point of focus is in the distance. How many images you will need is really down to the depth of field you can achieve with your camera.
To determine how many images you need in a set it’s best to shoot a test series. Compose your shot and focus on the nearest point in the frame. Take a shot and then review this on the camera at 100% magnification. As you do this, you are looking for the point at which the image starts to lose focus. This is the point where you need to focus for the next shot. Repeat the process until even the most distant object appears in focus. You now know the number of shots and the points of focus for the image sequence and can reshoot the image set.
In this example the images were captured using a Micro 43 camera. The smaller sensor of the camera allows it to achieve a greater depth of field at the same aperture when compared to a camera with a cropped or full frame sensor. Using a micro 43 camera I was able to shoot the images at f/8.0 (with limited diffraction) but achieve a good depth of field. Because of this, two frames were sufficient.
If you would like to follow the example you can download the two starting images here (approx. 12Mb).
Had I been using a full frame camera, I may have chosen to limit my aperture to f/12.0 for maximum sharpness. This however would require more images, possibly 4, 5 or more to cover the entire depth of field in the scene.
When shooting your image set, it’s important to minimise any variation between frames. The only difference between images should be where the point of focus is placed. This usually means the camera will need to be tripod mounted. Below you can see a sample from the two images in our example set magnified at 100%.
The image shows part of the foreground with the two images side by side, magnified to 100%. The left hand image was shot with the focus point on the foreground and the right hand image with the focus at infinity. Notice how the heather and rock in the right hand image are out of focus because there isn’t enough depth of field.
Compare this to the following screenshot.
Again, the image on the left was shot with the point of focus in the foreground whilst the image on the right was taken with the focus on the distance. Had I not shot and compared the two images it may have been tempting to think the image on the left had sufficient depth of field and the softness in the distant hills corrected with sharpening. But comparing the two, it becomes clear that depth of field is a problem.
Pre-processing Images for Focus Stacking
Having captured your image set, you may want to do some pre-processing before combining them into a single image. Some people believe it’s best to process an image set into a single image before applying any enhancements. Personally I like to enhance my RAW images (producing TIFF files) before combining them into a single image. If you follow my approach, be sure to apply identical adjustments to all the images in the set. Here is how I achieve this in Lightroom.
Below you can see three images in the Lightroom interface.
The first image in the set shows my fingers in front of the lens. I do this so that I have a marker image indicating the start of a set of images for focus stacking. The next two images are part of a stacked sequence with the first image focussing nearest to the camera. If I were going to shoot three images in the focus stack, I would have placed three fingers in front of the camera lens.
Notice also that the images in the set have been grouped into what Lightroom also calls a stack. This is to help with organisation. You can do this very easily by clicking on all the images to be grouped together and then right clicking with the mouse on one of the images. In the popup menu you can select the option “Stacking | Group into Stack” as shown in the screenshot below.
Having grouped the images into a stack the stack can be collapsed and expanded to show either the top image in the stack or all the images. At this point I also delete the image showing my fingers as it’s no longer needed.
Next select one of the images and switch to the Develop module so that you can apply your adjustments. You can see an example of this below where the first image in the set has been adjusted but the second hasn’t.
Select all the images in the set by holding down the Ctrl key (Command on the Mac) and clicking each image. With all the images selected, right click on one of them and select “Develop Settings | Sync Settings…” from the menu. You can see this in the screenshot below.
This will display the Synchronize Settings dialog as shown below.
Be sure to click the “Check All” button at the bottom as all the development settings need to be carried across exactly, to the other images in the set. Once all the settings are selected click the “Synchronize” button to apply them.
You have now processed all the images in the set identically and they can be exported ready for processing into a single image.
Processing the Image Stack
To process your image set into a single image (with increased depth of field), you will need special focus stacking software. If you use Photoshop, more recent versions do include this capability. There are also a number of software packages on the market to help you merge the images. Personally, having tried quite a few of these, I feel that Helicon Focus is the best. If you want to try the Helicon Focus software for yourself, you can download a fully functioning 30-day trial from their website.
The version of the software I’m using for this tutorial is 6.5. You can see the initial interface below.
The software is very easy to use, simply drag and drop the images from the set to be processed onto Helicon Focus. When you do this, the images in the set are opened and appear as small thumbnails in the top right of the screen. You can select any of these to display in the central part of the screen, by clicking them.
Below the image thumbnails are three methods that can be used to combine the images:
- Method A (weighted average)
- Method B (depth map)
- Method C (pyramid)
Personally I favour Method B but it’s worth trying them all initially. Select the method to be used and click on the “Render” button. The images in the set will then be processed into a single image with much greater depth of field. You can see this in the screenshot below.
The image on the left of the screen is the currently selected image from the set (thumbnails in the top right of the screen). The image to the right side is the new combined image with the maximum depth of field. Notice also that a number of tabs have appeared along the top of the screen (Rendering, Retouching, Text/Scale, Saving). These are the steps you can go through to finalise and save your combined image.
To the bottom right of the screen there are icons that can be used to zoom in and inspect the image. In the screenshot below you can see the image has been zoomed to 100% to compare the new image with one of the source images.
Comparing the image in this way allows you to determine if you need to repeat the Rendering step but using different settings (Radius and Smoothing) or even a different rendering method.
Once you are happy with the rendering you can click the Retouching tab. Here we can clean up any areas of blending where the software hasn’t selected the correct part of the image to blend or perhaps remove a moving object. In the following screenshot you can see that the depth map (generated by the software in the blending process) has been displayed.
Notice that the software has decided that one of the flowers should be included from the image where the focus is in the distance. This is probably because there is some wind movement in the flowers from the source image with the foreground focus. You can fix this by selecting the image where the focus is in the foreground and then painting the flower into the finished image.
Once you’re happy with the image click the Saving tab and then select to save the image as a TIFF file. This finished image can then be further processed in Lightroom, Photoshop or whatever editing tools you use.
Focus stacking is an excellent way to achieve exceptional depth of field and sharpness that wouldn’t otherwise be possible. The steps to achieve this are:
- Plan and shoot your image set.
- Adjust the images in the set so that all have identical enhancements
- Open the image set in the stacking software and render to a single image
- Check the rendered image and adjust as necessary
- Clean up any moving objects or problem areas
- Save your finished image
- Perform any final adjustments.