FOCUS STACKING IN MACRO PHOTOGRAPHY TO INCREASE DEPTH OF FIELD (DOF)
- Francisco Lopez
- Feb 19
- 6 min read
By: Francisco López-Machado
Biologist and Nature Photographer
Focus stacking is a key technique in macro photography that allows for overcoming one of its biggest limitations: Depth of Field (DOF). DOF refers to the range of an image that appears sharp, and in macro photography, it tends to decrease drastically due to the proximity between the camera and the subject. Additionally, large apertures (low f-stop values) are often used in macro photography, further reducing DOF and leaving important subject parts out of focus.
The goal of focus stacking is to solve this problem by taking a series of photographs of the same subject, each with a slightly different focus point. Instead of relying on a single shot to get the entire subject in focus, this technique allows focusing on different areas of the subject in separate captures, covering from the foreground to the background. Later, specialized editing software (such as Photoshop or Helicon Focus) combines the sharp areas from each image to generate a single photograph where the entire subject appears completely sharp. This results in a final image with great detail, impossible to achieve in a single shot without stacking.
In Figure 1, two images of the same beetle are shown, one dorsal and one lateral, clearly demonstrating the result of this technique.

Figure 1. Dung beetle Phanaeus hermes. The entire surface of the beetle is perfectly in focus, including its legs, antennae, and the large characteristic horn of the males of this species.
How to Do It:
Focus stacking may seem complex at first, but with the right tools and some practice, it becomes manageable. Here are some essential points to achieve optimal results:
Camera Stability: The camera must be fixed on a solid support, such as a tripod, since any movement during the sequence of shots can ruin the stacking process. Even minimal vibrations can cause misalignment of images, affecting the result.
Subject Immobility: The subject must remain completely still throughout the process. This is especially important for natural subjects like insects, where even the slightest movement can disrupt the focus sequence and misalign the images.
Uniform Lighting: Lighting plays a crucial role in focus stacking. It must be stable and consistent throughout the sequence to avoid variations in light or shadows between shots. Continuous light sources (e.g., LED) or specialized flashes can be used, ensuring that each photo has the same exposure and light direction.
Use of Focus Rails: A highly useful accessory for this technique is a focus rail, which allows the camera to be moved in very small increments without adjusting the tripod. This is essential for achieving a series of shots with progressive focus shifts. There are different types of rails:
Single-axis rail: Moves the camera only forward and backward, ideal for precise movements along the focal plane. Some include fine-tuning mechanisms that allow minuscule focus steps.
Two-axis rail: Provides greater flexibility, allowing adjustments both in the X-axis (horizontal) and the Y-axis (vertical). Recommended for studio work where all conditions are controlled, and framing adjustments are needed without losing focus precision (Figure 2).
Combining a focus rail with a sturdy tripod ensures that the camera remains completely stable during the sequence, allowing precise changes in the focus point without altering its position or compromising image quality. When used correctly, this technique results in exceptional detail in macro photography
Figure 2. At the top: Two-axis focus rail, designed to move the camera in four different directions. At the bottom: Precision focus rail, allowing much more accurate adjustments. Both devices facilitate better framing and greater precision in focus adjustment.
How to Capture Shots
There are two main ways to perform focus stacking:
Manual: Estimating DOF and the necessary number of shots.
Automatic: Using specialized software (e.g., Helicon Focus or Combine ZP).
DOF depends on the lens and f-number (aperture). In macro photography, focal lengths between 50mm and 180mm are commonly used, with an optimal f-number typically between f/8 and f/11. The lower the f-number (e.g., f/5.6), the wider the aperture and the shallower the DOF, requiring more images.
Once the aperture is selected, DOF can be calculated using online tools like DOFMaster. Alternatively, one can identify the closest focus point and gradually shift it with each shot. Avoiding large focus jumps is crucial to prevent blurred areas between images, which would result in unfocused zones in the final stacked image. Programs like Helicon Focus automate this process, calculating the necessary shots and performing the final stacking.
Lighting
Lighting is a key factor in focus stacking. Continuous light sources (e.g., LED) are preferable to avoid changes in shadows and intensity. However, specialized macro flashes or conventional flashes can also be used, triggered manually with a 10-second interval between shots to ensure full flash recharge.
A useful accessory is a lightbox, which can be made from foam board or similar materials to achieve soft and even illumination. (Figure 3).
Figure 3. Simple light-box made of MDF coated with white melamine, featuring six LED light tubes and the option to attach flash lights.
Post-Processing
The final processing of stacked images largely depends on the intended use and the required level of detail. For example, in biological collections digitization, where photos serve as visual documentation for scientific research, technical quality is paramount. Images must be sharp enough to reveal minute details (color patterns, textures, or specific morphological traits).
Such images often require high contrast and uniform backgrounds (white or black) to facilitate analysis and comparison in online platforms. Proper exposure adjustments, sharpening, and removal of imperfections are essential so that researchers can effectively study the specimens.
In Figures 3 to 5, examples of multiple shots required to compose a final detailed image are shown. Figure 6 demonstrates the result, capturing the specimen’s details with the highest possible precision.
Figure 4. First shot of a total of 32, showing the part of the beetle closest to the camera in focus.
Figure 5. Shot number 16 of a total of 32, showing the middle part of the beetle in focus.
Figure 6. Shot number 32 of a total of 32, showing the farthest part of the beetle in focus.

Figure 7. Diabroctis cadmus, final result of stacking 32 images with complete depth of field (DOF).
Additional Examples and Applications
Below are more examples of focus stacking applied to entomological collections. In some cases, specimens were found deceased and then prepared for photography using this technique. It is essential to note that none of the insects used were sacrificed for these images, emphasizing the ethical approach to scientific documentation.
Focus stacking also has applications in botany, where results can be spectacular when photographing flowers or other plant structures. Thanks to this technique, microscopic and complex details of plants that would normally remain out of focus can be captured, allowing botanical photographers to document each species' morphological characteristics with great accuracy.

Figure 8. Euglossa ignita, PNN Gorgona. Stack of 22 photographs, lateral view.

Figure 9. Dung beetle Dichotomius nisus, dorsal view.

Figure 10. A stunning emerald, green beetle Macraspis chrysis.

Figure 11. Native bee Exaerete smaragdina, an orchid pollinator, lateral view.

Figure 12. Male flower of the orchid Catasetum ochraceum. In this case, the focus stacking was applied to the first flower. The background flower was intentionally left out of focus as it did not provide relevant information, serving only for composition.

Figure 13. Male flower of the orchid Catasetum tabulare. In this case, the focus stacking was done against a black background to better highlight the flower's structures.

Figure 14. Flower of the orchid Cyrtopodium paniculatum. In this case, the flower was left in its inflorescence, which is why some other flowers can be seen in the background. The focus stacking was applied only to the main flower.

Figure 15. Flower of the orchid Catasetum bicolor. In this case, the flower was left in its inflorescence to prevent any deterioration during the photo sequence.
Conclusion
Focus stacking is a powerful and versatile technique in macro photography to overcome the limited Depth of Field inherent in this type of photography. Although it requires time, practice, and patience, the results can be impressive, achieving images with a level of sharpness impossible in a single exposure. This technique also expands creative and technical possibilities, making it valuable for scientific and artistic projects alike.
With the right tools and a basic understanding of the process, any photographer can experiment with focus stacking and achieve both aesthetically stunning and scientifically valuable results. Whether for artistic macro photography, research projects, or documentation of biological collections, focus stacking offers the opportunity to discover and showcase the finest details of the microscopic world around us. Give this technique a try and enjoy every step of the learning process!
Francisco López-Machado, Biologist and Nature Photographer
Created: March 2016 – Updated and translated: February 2025
Comments