Article – Image (Focus) stacking – Infinite depth of Field

Article – Image (Focus) stacking – Infinite depth of Field

Image stacking, technically speaking, is a pile of files, each consisting of one image. It is how you use them that makes the difference.

In essence, the four most common ways to use them are a) allow only the highlights of each shot get through to the others – of particular interest to star trailing, b) using them to create an HDR (High Dynamic range) image (in this case, the images stacked differ in exposure), c) create something surreal or a multiple exposure (this was used with film, too) and d) stack a series of images with different focus zones, to create an image with a seemingly huge depth of field. This last application is what we are going to discuss in this article, although some aspects can be applied in any kind of image stacking.

When you need it ? The fields that will benefit from this technique are primarily macrophotography (which always suffers from limited depth of field), studio photography and landscapes. You actually need it when it is impossible to get as much of the image focused using the classic approach. The classic approach calls for a very small aperture, but this causes very long exposures while at the same time degrades the overall image quality because of the introduction of diffraction. It may also bring into focus some distant elements you don’t want to. Focus stacking allows you to keep what you want in focus, all of it, but also allows you to keep unwanted elements blurred. It is up to you really to decide which settings to use for each set of images.

 

cocastcking

 

A Coca Cola bottle is taken out of the fridge and air humidity forms droplets on the bottle. Stacking of 11 photos, taken at 5mm steps. Theoretically, 1 mm steps should be used for optimum results, although this would result in 55 images to be stacked together or 2 GB of data. Technical : Nikon D800, Zeiss 100mm Makro Plannar, ISO100, f/5.6, 1/4 sec, manual focusing & exposure mode, Novoflex focusing rail, Benro tripod, Mirror lock up – no flash used. Stacking was done using Helicon focus. NEF (RAW) files were opened and processed using DNG converter (free for download at www.adobe.com).  Image size: 2500×2518

 

What you need ? You need a set of images taken from the same point, using identical exposure settings for all of them. This calls for a tripod of course, and the more sturdy the tripod, the better the outcome will be. For macro photography you may have to move your camera a tiny bit between shots (this may be as little as 1 mm) so a focusing rail comes in handy. Your lens should be focused manually even if it has auto focus capabilities. You need absolute control on focusing so you can’t rely on AF systems which may focus on a different part of the frame. Finally, you need  a subject that won’t move between shots. The reason you use focus stacking is because you need maximum detail, resolution and sharpness so you will probably use the mirror lock up setting of your camera, this, along with the careful movement of the camera – lens system after each shot, means it takes approximately 30-40 seconds for one shot.

 

stackingsetup

 

To ensure maximum detail in the photos that are presented in this article, we had to leave the room when the picture was actually taken, to avoid vibrations getting to the camera through the wooden floor. Although this may be viewed as an extreme measure, standing or walking on wooden floors can sometimes ruin your photos, especially if you are going for maximum detail and resolution – as we did.

 

How to do it ? Good news on this one, it is a very easy and straight forward technique which doesn’t require special skills or gear. You place your subject in front of the camera and you set your camera’s focusing system to “manual” – it is better to set the exposure settings manually, too.  You then choose which aperture you want to use (ideally you choose the one at which your lens works best). In the photos that accompany this article, we chose f/5.6 on a Zeiss 100mm f/2 Makro Planar because this is where this lens delivers maximum resolution.

Next step is doing a bit of research on the internet, to find the depth of field you get for this aperture, focal length and camera to subject distance. Things become a bit more tricky, because you need to know the distance of the optical center of the lens to the subject but you can use the edge of the lens for the calculations, you are always on the safe side since this will give you a shallower DOF than you really have. While doing this research, it would be nice to find the Circle of Confusion (CoC) for your camera’s sensor as this will result in optimal results. For the Nikon D800 we used to create these images, Lloyd Chambers reports a CoC of 5 microns which we entered in the DOF calculator (there are many of these on the web and most are free) and the result was that for the parameters we had in hand (f/5.6, focal length 100mm. 45cm camera to subject distance, CoC = 5 microns) the calculated DOF was a mere 1 mm.

 

rosestacking01

White rose, stacking of 12 photos. Technical: Nikon D800, Zeiss 100mm Makro Plannar, ISO100, f/5.6, 1/5 sec, manual focusing & exposure mode, Novoflex focusing rail, Benro tripod, Mirror lock up – no flash used. Stacking was done using Helicon focus. NEF (RAW) files were opened and processed using DNG converter. A halogen lamp light fixture was used for lighting, the White Balance was changed to a cooler temperature in post processing. Droplets were sprayed on the rose using a mixture of glycerin – water which allows them to keep their shape and not “run” during the process, which lasted almost 15 minutes. It is important to fix your subject in such a way that it will stay still throughout the whole process. Image size: 2000×1881

 

The next step is to focus on the part of your subject which is closest to your camera. This is the single most important thing in this process. You have to be sure you have focused on the truly closest part of the subject. In the case of flowers take a good look at the sepals and petals to make sure you have chosen the most protruding one. Then focus on this part of the subject as carefully as you can. Using Live View will allow you  to magnify the area you want to focus on and achieve critical focusing.

These steps have to be followed for all types of focus stacking. For macrophotography, an item that comes in handy is a good quality tripod coupled to a good quality focusing rail. We use a Benro carbon tripod which is very stable, especially when all the legs are collapsed. Our focusing rail is made by Novoflex and its overall quality is unsurpassed. It is a heavy type of rail, extremely stable and can hold the camera in place firmly. It will easily allow you to move the camera – lens system by as little as 1 mm at a time. You can see it on our tripod in the picture of the setup below.

 

rosebudstack

White rosebud, detail of the inner flower – 18 image stacking, using a 2 mm step. In this picture we took the shot at an angle which greatly increased the number of shots needed for focus stacking. Keeping the subject still at this angle was also an issue. Technical: Nikon D800, Zeiss 100mm Makro Plannar, ISO100, f/5.6, 1/25 sec, manual focusing & exposure mode, Novoflex focusing rail, Benro tripod, Mirror lock up – no flash used. Stacking was done using Helicon focus..  Image size: 1600×1621

 

 

rosebudredstack

 

Red rosebud. 28 image stacking, using a 1.5 mm step. In this photo, exposure was a bit tricky, since there is, actually, only one color channel recording data. We took a reading from the brighest part, another one from the darkest and used the average as exposure settings. Technical: Nikon D800, Zeiss 100mm Makro Plannar, ISO100, f/8, 1/8 sec, manual focusing & exposure mode, Novoflex focusing rail, Benro tripod, Mirror lock up – no flash used. Stacking was done using Helicon focus. Image size: 2000×2371

 

Exposure should be in manual mode and kept the same for all exposures. The ISO should be set to the lowest possible value(basic ISO) to ensure maximum dynamic range. In the case of a landscape focus stacking, the shots can be taken really fast, so there is no risk of changing light conditions. In the case of macrophotography, which takes too long, you should make sure that the light conditions are the same throughout the session. You may use a portable flash, studio flash lights or even an ordinary house light fixture.

 

rosebudanglestack

 

White rosebud, detail of the inner flower – 21 image stacking, using a 2 mm step. Changing the angle a little bit allowed for better illumination of the interior of the flower. In photos like this, there is an almost 3D effect in the final result. Technical: Nikon D800, Zeiss 100mm Makro Plannar, ISO100, f/5.6, 1/25 sec, manual focusing & exposure mode, Novoflex focusing rail, Benro tripod, Mirror lock up – no flash used. Stacking was done using Helicon focus. Image size: 2000×1495

 

Advantages : After working with this project for some time, it became evident that there are some clear advantages in image stacking when compared to a direct, classic shot.  First of course, it is the extended depth of field but it is a lot more than that. What’s more ? We are working at basic ISO therefore we get the best dynamic range, which allows us to do some things more in post processing. There is no need to climb the ISO scale, therefore we get crisper pictures without noise.  We also avoid diffraction, since we don’t have to step down the lens in order to achieve the depth of field we want, again resulting in “cleaner” pictures since we avoid diffraction while at the same time using the lens at its best aperture. As if this was not enough, we have huge creative potential. If the whole scene was shot with an aperture of f22, even the background would somewhat show in the final pictures. With focus stacking we can use a relatively wide aperture (f/4-5.6) which will result with our subject in perfect focus while the background stays blurred. With the correct framing, we end up with a crisp picture which has a huge depth of field covering our subject, leaving the background out of focus. It is up to us to take further shots and bring the background in focus, if this is our intention.

 

rosebud001

 

White rosebud. 30 images stacked, using a 1.5mm step and an aperture of /8 ensuring a more gradual transistion from one plane to another since there is a significant overlap of “in focus” zones. The result shows even better results than the previous ones. Technical: Nikon D800, Zeiss 100mm Makro Plannar, ISO100, f/8, 1/13 sec, manual focusing & exposure mode, Novoflex focusing rail, Benro tripod, Mirror lock up – no flash used. Stacking was done using Helicon focus. Image size: 2500×1748

 

Disadvantages : There are disadvantages, too. The main problem is the time it takes to finish the shooting stage. Each photo will take at least 30 seconds, so, for a subject measuring 3 cm you will need 10 to 30 shots or 5 minutes at the very least. This excludes all moving subjects (e.g.  moving grass in a landscape, insects or other animals etc.) and limits its usefulness in still-life like setups.

If high shutter speeds can be used, then it is entirely possible to apply this in landscape photography, taking the shots on a tripod but without using the mirror lock up feature which slows the process considerably.  You can decide on which “axis” you want to go and then take 10 shots by refocusing between them.  It helps a lot of you have already decided on which elements of the landscape you will focus – to save time. In this case, remember that you need small steps for items which are closer to the camera and larger steps for mid-range elements.

An example of this technique is shown below. This is a morning shot, unfortunately there was a light breeze which made things a bit difficult (we had the take the shots while the breeze stopped). There 8 images stacked to create the photo you see below. One in front of the bag, the second on it and six more behind it. Perhaps we needed one more in front of the bag but we didn’t notice the tips of the grass at the very bottom of the frame. We used f/8 and all settings – including focusing, were manually set. A Nikon D3x with the Zeiss 100mm f/2 Makro Plannar was used for the shots, 1/100 s, ISO 100. The camera was firmly attached on a Benro tripod. This scene was chosen because it has “continuous” information over the entire depth, which is impossible to capture with a classic shot, especially with an 100mm lens. With this shutter speed we didn’t have to rely on mirror lock up, we just focused on the preselected point, took the shot and then moved on to the next point. This way, one can take all 8 shots within 4-5 seconds, so there is no risk of clouds that have moved etc.  As for the distances, the bag was placed at 2 meters in front of the camera, while the part in the upper left side of the frame is 15 meters away.

 

photobag04

Taking focus stacking in the wild. If there is no wind, this technique can produce equally interesting results out, in the open.

 

How to handle the images? The images have to be stacked together using an appropriate software – preferably one that runs on fully automated mode. Photoshop offers this but it is rather cumbersome. The software preferred by us is Helicon Focus which works with RAW files, although you will need to install DNG converter. Set the output file to TIF 16 bit so you have some flexibility when doing post processing in Photoshop or Lightroom.

Some other titles for Focus stacking include the following :

ALE David Hilvert Linux, Windows GPL
CombineZ Alan Hadley Windows GPL
Helicon Focus Danylo Kozub Windows, Mac OS X Proprietary, 30-day trial
Extended Depth of Field
plugin for ImageJ
Alex Prudencio, Jesse Berent, Daniel Sage Multi-platform (Java) Free for use for research
PhotoAcute Studio Almalence Inc Windows, Mac OS X, Linux Proprietary, time-unlimited trial
Stack Focuser
plugin for ImageJ
Michael Umorin Multi-platform (Java) GPL
Adobe Photoshop CS5 Adobe Windows, Mac OS X Proprietary
Enfuse (+ align_image_stack or similar) Andrew Mihal, hugin development team Multiplatform GPL
Macnification Peter Schols Mac OS X Proprietary, 30-day trial
Zerene Stacker Rik Littlefield Windows, Mac OS X, Linux Proprietary, 30-day trial
Image Pro Plus Media Cybernetics Windows Proprietary
Zeiss Axiovision Carl Zeiss AG Windows
Tufuse Max Lyons Windows
PICOLAY Heribert Cypionka Windows Proprietary
Deep Focus module for QuickPHOTO

 

Verdict : As with all techniques, it is up to the photographer to use it efficiently and creatively. The technique has some pros and cons but we feel the former outnumber the latter. In some cases, you can take a similar picture without focus stacking.  However, when you want to be creative and use depth of field as your tool, this technique comes in handy. It is simple, quick and produces some impressive results.

 

by Marina Parha & George J. Reclos