top of page
Deutsch.jpg
LogoSchwarzRot100px.jpg

Focus stacking - endless depth of field!

Text and photos: Daniel Knop

Aufnahmevorrichtung für Focus Stacking (Eigenbau) auf Basis einer CNC-Schiene, ausgestattet mit manuellem Lineartisch, Novoflex Castel micro, Lichtdiffusor, höhenvariablem und in zwei Ebenen verschiebbaren Objekthalter sowie drei verschieblichen Schwanenhals-Blitzhaltern

Self-made fixture for focus stacking based on a CNC rail, equipped with manual linear stage, Novoflex Castel micro, light diffuser, height-adjustable and two-level adjustable lens holder and three adjustable gooseneck flash holders

Depth of field is the big problem in macro photography, and the closer the camera gets to the subject, the more dramatically the zone of sharpness shrinks. Of course, blurring can simply be declared a creative stylistic device, but this is not everyone's cup of tea. It is better to simply increase the depth of field, as this is not difficult at all. 

 

The focus stacking technique can extend the depth of field to any size. On this website, I try to convey the basic knowledge for this in a very easy-to-understand way with numerous individual topic contributions. I am normally an author of non-fiction and specialist books, but here I am trying my hand at a digital medium: over the coming months, the blog on this site will feature further articles on topics that are important for focus stacking, like the chapters of a book, so to speak. 

 

Microscope lenses

If you want to take a magnified image of the small world, sooner or later you will end up with microscope lenses, many of which can also be attached directly to a camera. They have a much finer reproduction of detail than a normal camera lens. Discovering nature with them is fantastic. It's not just educational, it's downright addictive! However, the depth of field is as thin as a sheet of paper and nothing works without the focus stacking technique. 

 

Many people shy away from this because it sounds complicated. But it's actually quite simple once you understand the basic principle. Some modern cameras can even do this automatically with macro lenses, and in a few years most cameras will probably be able to do this, even in smartphones. And it can also be automated very well with microscope lenses and then works virtually at the touch of a button.

Optische Bank Focus Stacking Daniel Knop
Canon R3 beim Focus Stacking

Wing scales of a butterfly, each only a tenth of a millimeter wide - nature couldn't be more colorful!

 

 

HLB Planapo 20x lens, Raynox DCR150 tube lens, Canon R3 camera, electronic shutter, three Godox flash units, 250 single images, Novoflex Castel micro controller, Helicon Focus software

Focus Stacking Flügelschuppen Schmetterling

What is focus stacking?

Focus stacking is taking a series of pictures with a slightly shifted focus plane. Shot by shot, this focus zone is moved further across the entire object so that it is positioned slightly differently in each individual photo. Special software is then used to automatically combine all the sharp details into a single image. In the case of macro photos, this can be five or ten individual images, for example, which can also be done on the move, e.g. in the garden to photograph pollinators in a flower. With microscope lenses, the number of individual shots is much higher, but the principle is the same. 

Focus Stacking Novoflex Castel micro

Focus stacking with a macro lens (Canon MP-E 65) on a tripod - so flowers are in focus from front to back

In-camera focus stacking

Some modern cameras can also carry out focus stacking internally by shifting the focusing plane in small steps via the autofocus motor. Some call it focus bracketing or something else, but the principle is always the same: You enter how long the shooting distance should be (usually just a number between 1 and 10) and how many individual steps are required. The length of the individual steps is then usually calculated internally by the camera. Press the shutter button and the series runs in fractions of a second. Some cameras then export the individual images, others process them internally to create a finished image with a continuous depth of field. 

Doppelblitzhalter Makro Daniel Knop

Homemade double flash holder with flash diffuser, made from the shade of an IKEA ceiling light - so you can also take mobile shots with a large depth of field using internal focus stacking

The settings for internal focus stacking (here Canon R3) are simple, and good shots are achieved after a short period of practice.

Canon R3 Focus Bracketing

In-camera focus stacking

Some modern cameras can also carry out focus stacking internally by shifting the focusing plane in small steps via the autofocus motor. Some call it focus bracketing or something else, but the principle is always the same: You enter how long the shooting distance should be (usually just a number between 1 and 10) and how many individual steps are required. The length of the individual steps is then usually calculated internally by the camera. Press the shutter button and the series runs in fractions of a second. Some cameras then export the individual images, others process them internally to create a finished image with a continuous depth of field. 

Alcidodes ocellatus Daniel Knop

Weevil Alcidodes ocellatus, taken in focus stacking with 100 individual images, sharp from front to back and in such high resolution that the image can easily be printed with an edge length of two meters

At magnifications of 10x or 20x with microscope lenses, it can easily be 150 or 200 to 300 images, sometimes even more. In this case, it is very advisable to carry out the whole process motorically, with a control unit. But there are technical solutions for this too.

Optische Bank Focus Stacking Daniel Knop

A stable base is essential for working with large image scales. A second monitor, however, is usually not necessary; here the right one makes it easier to place objects under visual control, while the left one helps with operating the control unit.

Focus stacking on the microscope

However, microscope objectives can also be used for focus stacking without a special rail setup and linear stage - namely on a microscope. This makes this photographic technique highly interesting for science, as research and publications are constantly being carried out in medicine, biology and other fields, and photos are needed for this. The tiny depth of field has always been a problem with such image documents, but fantastic microscope photos with endless depth of field can now be produced with focus stacking. You can simply work manually with the fine adjustment and achieve excellent results this way. However, I have equipped one of my microscopes - an Orthoplan from Leitz - with a motor drive that I can program precisely via a control unit to produce fully automatic image series, as this is even more convenient and also better at high magnifications.

Mikroskop mit motorischer Steuerung
Mikroskop mit motorischer Steuerung

Leitz routine microscope with self-built motor drive based on the Stackshot control unit (Cognisys) for automatic creation of focus stacking images

Clematis Vergleich Normalaufnahme Focus Stacking

Detail from a botanical stain preparation (clematis stem, cross section, 50x oil immersion, enlarged); on the left a single image showing the shallow depth of field, on the right a focus stacking image calculated from numerous individual images, with depth of field over the entire image

The camera

In principle, all digital cameras are suitable for focus stacking. This is also possible with SLR cameras, but the more modern mirrorless system cameras, which work with an electronic shutter, are ideal for this. This not only saves us the vibration, but also the mechanical wear and tear. I myself mostly work with a Canon R3 and sometimes with a Canon R5II and, because they even allows me to use the electronic shutter with flash units. Most other mirrorless cameras can only do this with continuous light. But that's not a problem either, there are good, affordable solutions with bright LED spotlights.

 

It is important to have a computer monitor connected directly to the camera so that you can see the Live View image clearly and in great detail before taking the picture, far better than on the small camera display. This allows the thin focal plane to be moved in a very controlled manner, either manually or using a motor. And even if a monitor is connected to your camera, it should still have a free socket for the remote shutter release. Some cameras, for example, only have a single USB socket to which you can connect either an external monitor or a remote shutter release. The remote shutter release interface is not only necessary to avoid vibrations, but also to connect a motorized control, which not only moves the camera forward in tiny steps, but also triggers it afterwards.

Optische Bank Focus Stacking Daniel Knop

A computer monitor that is connected directly to the camera and shows the live view image is essential for good image results

Motorized or manual?

A manual linear stage is usually the first choice for focus stacking. This is actually nothing more than a macro slide, only heavier and more precise. It must be absolutely free of play so that nothing wobbles at all. You mount your camera on it, and after every tiny movement of the rotary handle to move the camera forward, you press the remote release - by radio or cable. In this way, you work through the entire shot, step by step, always keeping your eyes on the monitor so that you don't push the tiny depth-of-field zone too far forward. In the individual images, these zones should each overlap by about a third so that the software can assemble them better and seamlessly later. 

 

However, I now only work motorized, because large series with 300 or more individual images quickly become tedious, especially if you have to repeat them several times. A good control unit remembers the start and end point of the total distance, and once you have entered the desired number of images, it automatically calculates the step size. And to repeat the whole series, e.g. with more individual shots, you simply press a few buttons and everything runs fully automatically. That's my favorite way to work.

 

However, I designed my system so that there are two linear stages on top of each other, a manual one at the bottom and a motorized one above it. I use the lower one for fine adjustment, as it allows me to move the camera forwards and backwards by fractions of a millimeter. In addition, the entire camera assembly is on rails so that it can be moved forwards and backwards as a coarse adjustment. 

But you don't have to invest in a motorized linear stage with a control unit to get started. A simple manual linear table, such as those sold for CNC milling machines, is sufficient to start with. My manual one is an example of this. Once you have worked with it for a while and gained experience with a simple microscope objective with moderate magnification, e.g. 4x or 10x, you will quickly realize whether focus stacking photography is your thing or not. If so, it also makes sense to purchase a motorized linear stage with a control unit, which will allow you to carry out much more demanding work with larger image scales and more individual images. 

Lineartische motorisch

Two linear tables, above a StackShot model from Cognisys, which also includes an external control unit, below a stable aluminum linear table from the CNC milling supplies. The system shown above has now been replaced by Castel micro from Novoflex, and the one below is used as a manual linear table (picture on the right).

Optische Bank Focus Stacking Daniel Knop

By placing a manual linear table (below) and a motorized system (above) on top of each other, it is possible to work both manually and motorized without having to convert, and you can also fine-tune the camera position by hand below.

Flash or LEDs?

Flash units or LED light? Both solutions are possible and produce good images, but both also have advantages and disadvantages. Flash units usually offer more sharpness because they freeze the slightest movements due to their short flash duration of one ten-thousandth of a second or less. However, they usually have the disadvantage that they are powered by rechargeable batteries. You can reduce the power consumption of each individual flash by using several units so that each one has to provide less light output. This is also advisable so that the light is better distributed, and it also shortens the burn-off time of the flashes even further, which freezes movements even better. Nevertheless, you always struggle with battery power during long series and have to hope that they hold out and don't give up in the middle of the series. That's why I've now bought two studio flashes with a mains connection, and the battery problem is a thing of the past. I only use the battery-powered flash units when I need more light sources.

Optische Bank Focus Stacking Daniel Knop Blitze

Two studio flash units with mains connection – conventional flash units can also be used, but this is much more convenient, especially since they can be continuously adjusted using the rotary control and even have an LED modeling light that switches off automatically during flash generation

Optische Bank Focus Stacking Daniel Knop LED

Studio LEDs today provide completely sufficient amounts of light for focus stacking work with microscope lenses and their brightness can also be continuously adjusted

LED spotlights are usually powered from the mains, so there is no battery charging problem. However, when working with LED lights, I initially had great difficulty avoiding blurring; all the images were blurry and the expected crisp sharpness was completely missing. However, at that time I was still working with SLR cameras and my LEDs were too weak. I now achieve almost the same sharpness with LEDs as with flash. The so-called silent shutter release can help with some cameras, because the first shutter curtain is replaced by de-energizing the sensor and switching it on when the shutter is released, which avoids the vibration of an opening mechanical shutter. The second shutter curtain then falls mechanically, but the exposure is already finished at the time of the shake. In this way, I was able to take quite sharp LED series. But now I work with the Canon R3 or R5II, which masters both flash series and LED series with the electronic sensor.

 

The diffuser

An extremely important component is the diffuser, which transforms the concentrated light beam from flash units or LED spotlights into soft, diffuse light and prevents bright reflections on the subject. You can often read on the Internet that a table tennis ball, ground on both sides, should be pushed onto the microscope objective in order to diffuse the light. In practice, however, this hardly works at all, as the distance between the diffusion surface and the object is far too small at around 15 millimeters. A long distance is needed here so that the light beam can spread widely. I work with the shade of a certain IKEA lamp (model “Melodi”, 28 cm diameter), which I have modified accordingly, as can be seen in the pictures. After many attempts with table tennis balls, yoghurt pots, paper cups and other utensils, this is by far the best diffuser I have ever had. 

Optische Bank Focus Stacking Daniel Knop
Focus Stacking Diffusor Daniel Knop

A good light diffuser is crucial for image quality. It can easily be made from a suitable lampshade. Here it has been fitted with a device for height adjustment

The stacking software

Once you have your series of images in the can, it's time for what is known in the world of film and photography as post-production: the work after the actual production of the material. You move all the images to your computer's hard disk, preferably in RAW format, i.e. not yet converted to JPG or TIF. I let my camera load all the images directly onto the computer while I'm shooting, because then I can already see each finished individual image on the monitor. 

Focus Stacking Daniel Knop

Tethering: The individual images are transferred to the image archive program while they are being taken. An alternative would be to read the entire series of images from the memory card. From here, the selected photos are then exported for editing in the focus stacking software

The first step in post-production for me is always to view the series to see which of the first images have sharp contours. All completely blurred images are simply deleted. Then I look for the last image in which a sharp detail can still be seen. These two images are then exported with all the files in between. For routine work, I choose the JPG format and a slight compression of around 80 percent - this is practically invisible later, even when enlarging. Only if I want to create a photo of particularly high quality, e.g. for a photo competition or for book printing, do I choose the TIF file format, which preserves a red, green and blue color separation but requires considerably more storage space. However, there is no image processing here, as I only do this on the finished image afterwards. 

 

The images are then dragged and dropped into the focus stacking software. You can usually set a few editing parameters there to optimize the result depending on the subject characteristics, but it is advisable to work with a basic setting that is equally suitable for most subjects, which makes things much easier at the beginning. Once the files are in the software, the process is simply started with a click. The calculation time depends not only on the file size and number of images but also on the computer performance. For me, it is usually only a few seconds to a maximum of half a minute, but the latter only for larger image series in TIF format. I generally work with Apple computers, mostly with a MacBook Pro (M1 pro max), but occasionally also with the small Mac Mini (M1), which is only slightly slower when it comes to calculations. However, it works just as well with Windows computers.

Focus Stacking Daniel Knop Helicon Focus

The focus stacking software calculates the resulting image with a continuous focus zone (here on the right) from the individual images (here on the left)

I then move the resulting image from the stacking software into my image archive program. I use Capture One Pro here, but Lightroom or one of the many other programs is also suitable for this. Here I check the quality and enlarge the file to at least 100 %, and usually much higher, up to 400 %. I can then see whether the number of individual steps was sufficient or whether the series needs to be repeated with more and smaller steps. The control unit and object are then still on hold and I could start the next series at the touch of a button if necessary, for example with 300 instead of 200 individual photos. I know that there are complex ways of calculating the step size formula, but I like the work to be simple and clear. 

Chrysididae Focus Stacking Daniel Knop
Chrysididae Focus Stacking Daniel Knop

The section of the abdomen of this 9 millimeter long golden wasp of the Chrysididae family shows fascinating colors and structural elements

Enjoy reading and have fun with your focus stacking journey of discovery through the world of the small!

Focus Stackong – was ist das?
Focus Stacking – what's that?
bottom of page