How does focus stacking create greater depth of field in macro photography?

Macro photography suffers from extremely shallow depth of field because magnification reduces the zone of acceptable focus and photographers must often use small apertures that introduce diffraction. Focus stacking solves this by combining multiple exposures taken at incremental focus positions so that each image contributes its sharpest regions to a single composite image. Research by Ramesh Raskar Massachusetts Institute of Technology helps explain the computational principles behind creating all in focus images using computational imaging, while practical workflows are described by Julieanne Kost Adobe in tutorials aimed at photographers.

How focus stacking produces greater depth of field

The technique captures a sequence of images from the closest focused plane to the farthest, moving the focus by small, controlled steps. Each frame contains a thin slice of the subject in sharp focus. Stacking software aligns frames to correct slight shifts and then analyzes local contrast to select the sharpest pixels from each image. These sharp regions are blended into a final image that shows continuous focus across the subject. Alignment and blending often use multi scale methods to preserve texture and avoid seams. Smaller focus steps yield smoother transitions but require more frames and greater care to avoid motion blur.

Causes and practical consequences

The physical cause is optical: at high magnification depth of field is proportional to the square of aperture and inversely proportional to magnification, so achieving extensive DOF in a single exposure is impractical without severe diffraction softening. Focus stacking therefore trades capture and computation time for image sharpness. Consequences include the need for stable platforms like rails or tripods, careful lighting to maintain consistent exposure between frames, and post processing that can introduce artifacts when parts of the subject move between exposures. Live insects and wind in natural habitats complicate stacking and may require different ethical and technical approaches compared to studio subjects.

Beyond technical results, focus stacking affects aesthetic and cultural practices in photography. Scientific imaging and natural history documentation benefit from increased detail, aiding species description and conservation outreach. In territories where endemic species are fragile, photographers must balance the desire for perfectly sharp images with the environmental impact of prolonged handling or lighting. The method expands what is visually communicable in macro subjects, but it also demands attention to technique, ethics, and post processing choices to produce credible, high quality results.