Why Magnification Changes with Focus Distance

The relationship between focus distance and magnification in a macro system is a consequence of the optics involved. For a simple lens, magnification is determined by the ratio of image distance to object distance. As the lens is racked closer to the subject to focus on a nearer plane, the object distance decreases, and the magnification increases. The subject's image on the sensor becomes fractionally larger.

In a focus stacking workflow using a rail, it is typically the camera and lens together that advance toward the subject rather than the lens elements changing their internal configuration. This means that across a deep stack, the camera physically moves closer to the subject, by several microns to several millimeters, with a corresponding shift in effective magnification across all those frames.

The effect is minimal in shallow stacks but accumulates meaningfully in deeper ones. In a stack covering several millimetres of subject depth at 5× magnification, the magnification shift from the first frame to the last can be enough to cause visible misalignment of features at the image boundaries, even after the stacking software's scaling correction has been applied.

How It Manifests in the Final Image

Stacking software accounts for magnification breathing through a scaling step during alignment: each frame is resized slightly to match a common reference magnification before the sharp regions are composited. When this correction works well, the effect is invisible. When it is imperfect, or when the magnification shift is large enough that the scaling introduces resampling artifacts, the result is a subtle but characteristic degradation: edges near the centre of the image may appear sharp while edges near the frame periphery soften or show slight doubling. Structures near the image boundaries are more susceptible than those near the optical axis, because the scaling correction is anchored to the centre and errors accumulate toward the edges.

This peripheral softening is easily confused with other problems such as field curvature, focus step errors, or simple lens softness at the edges. Diagnosing it correctly requires examining whether the degradation is consistent across all stacks made with the same system or whether it varies with stack depth.

Which Systems Are Most Affected

Magnification breathing is most pronounced in extension tube setups, where a fixed focal length lens is displaced from its designed flange distance and the entire optical system moves as a unit during rail advance. It is present but typically less severe with purpose-designed macro lenses, which are optically corrected to maintain consistent magnification across their focus range. The Laowa 25mm f2.8 Ultra Macro, designed specifically for the 2.5–5× range, performs better in this respect than an extension tube configuration, but some breathing is unavoidable at these magnifications.

Microscope objective setups on bellows or tube lens systems have their own version of this problem: because the working distance of a microscope objective is extremely short and fixed, the rail advance needed to traverse even a fraction of a millimetre of subject depth represents a substantial proportion of that working distance, with corresponding magnification consequences.

Mitigation

The primary mitigation is to keep individual stacks as shallow as possible — covering only the depth range actually needed and avoiding unnecessary extra frames beyond the subject boundary. For subjects with genuine depth, this may mean planning the stack carefully to understand where the critical structures are, rather than beginning the rail well before the subject and ending well after it.

Using a rail setup that advances the subject toward the lens, rather than advancing the lens toward the subject, can reduce the effect in some configurations, as it changes the geometry of how object distance changes across the stack. This is not always practical with live or delicate subjects.

Accepting a small crop of the image periphery in post is sometimes the most pragmatic solution: if the magnification breathing is minor and confined to the edges of the frame, cropping to a region unaffected by the scaling correction recovers a clean result with minimal loss of the subject.

← Previous: Subject & Camera MovementBack to all notes →