Focus Stacking: When Depth of Field Isn't Enough
There are subjects where no single aperture setting will give you enough depth of field β no matter how small you stop down. Focus stacking is the solution: multiple frames at different focus distances, blended into one image with front-to-back sharpness that physics alone can't deliver.
When You Actually Need Focus Stacking
Most photography never needs focus stacking. But in two situations it becomes genuinely necessary rather than just helpful:
Macro Photography
At 1:1 magnification, depth of field at f/11 on a full-frame sensor is roughly 0.5β1mm. A coin, a flower stamen, an insect eye β subjects measured in millimetres have features that extend several times further than your entire available DOF. Stopping down further into diffraction territory (f/16, f/22) actually makes the image softer, not sharper. There is no aperture that solves this. Stacking is the only answer.
π DOF at Macro Distances (Full Frame)
At 1:1 magnification (subject fills sensor):
f/5.6 β DOF β 0.25mm
f/8 β DOF β 0.36mm
f/11 β DOF β 0.50mm
f/16 β DOF β 0.72mm (diffraction starting)
A common beetle is 10β15mm long. At 1:1, you need 20β30 frames to cover it front-to-back.
Landscape and Architecture at Close Range
When a foreground element β a rock, a flower, a tide pool β is 30β60cm from the lens and you want both it and the distant horizon in sharp focus, the hyperfocal distance technique starts to break down. The near subject is inside the near DOF limit even at f/16. Stacking two or three frames (foreground, midground, background) cleanly solves what hyperfocal focusing cannot.
When Aperture Alone Works
β’ Subjects more than 1m away with moderate depth requirements
β’ Landscapes where foreground is beyond 1m
β’ Portraits, street, most general photography
β’ Any scene where f/8βf/11 covers the needed depth
When You Need Focus Stacking
β’ Macro at 1:2 magnification or closer
β’ Product photography requiring edge-to-edge sharpness
β’ Insects, flowers, minerals, food photography
β’ Landscapes with foreground subjects within 50cm
β’ Scientific and technical photography
The Physics Behind It
DOF decreases with the square of magnification. Double your magnification and DOF drops to one quarter. This is why stacking becomes unavoidable quickly in macro work β there's no lens design or aperture choice that escapes it. The only way to have a sharp image of a subject deeper than your available DOF is to combine multiple images, each focused on a different plane within the subject.
π‘ Diffraction: Why Stopping Down Past f/11 Hurts
At f/16 and beyond on most cameras, diffraction softens the entire image. The smaller aperture does increase DOF slightly, but overall resolution drops. The sweet spot for macro stacking is typically f/5.6βf/8 β enough DOF per frame to blend cleanly, sharp enough to hold fine detail. More frames at a good aperture beats fewer frames at a tiny aperture.
Shooting a Focus Stack: Step by Step
-
Lock down your camera on a tripod. Every frame must be pixel-identical except for focus position. Even slight vibration creates misregistration that stacking software struggles to correct. Use a remote shutter release or 2-second self-timer. Mirror lockup on DSLRs. Electronic shutter on mirrorless where available.
-
Set exposure manually. Aperture priority or auto exposure will cause brightness shifts between frames as focus changes slightly alter the light path. Use manual mode. Set aperture to f/5.6βf/8 for most macro work. Fix ISO and shutter speed.
-
Identify the front and back focus planes. Focus on the nearest element of your subject that you want sharp. Note this position. Focus on the furthest element. Note that position. These are your stack boundaries.
-
Shoot from front to back in small steps. Move focus slightly toward the background between each frame. The step size depends on your DOF per frame and subject depth β you want about 20β30% overlap between adjacent frames' sharp zones. For a 10mm beetle at 1:1, this typically means 15β25 frames.
-
Don't move the subject or change lighting. Moving air, unstable lighting, or live subjects are the enemy of clean stacks. Shoot in still air. Use continuous artificial lighting rather than flash if possible (some flash units shift colour temperature slightly between shots).
Manual Focus vs Focus Rail vs In-Camera Bracketing
| Method | Precision | Speed | Best For |
|---|---|---|---|
| Manual focus ring | LowβMedium | Slow | Landscapes, large subjects |
| Focus rail (macro rail) | High | Medium | Macro, repeatable increments |
| In-camera focus bracketing | High | Fast | Any β modern mirrorless standard |
| Automated rail + controller | Very high | Medium | Scientific, extreme macro |
In-camera focus bracketing is now the most practical option for most photographers. Canon RF, Nikon Z, Sony, Fujifilm, and OM System cameras all offer it β you set the number of frames and step size, and the camera shoots the sequence automatically. The results are consistently spaced and far faster than manual focusing between shots.
π‘ In-Camera Bracketing Step Size
Most cameras use a 1β10 scale for focus step size rather than mm values. Start at step 1β2 for macro subjects at 1:1, step 3β5 for larger close-up subjects. Shoot a test stack and check in software β if you see blurry gaps between sharp zones, reduce the step size and reshoot.
Blending the Stack: Software Options
Adobe Photoshop (Auto-Blend Layers)
The most accessible option for most photographers. Load your frames as layers (File β Scripts β Load Files into Stack), select all layers, then Edit β Auto-Blend Layers β Stack Images. Photoshop analyses sharpness across each layer and creates masks to show only the sharpest regions from each frame.
Works well for 5β15 frames on standard macro subjects. Struggles with complex transparent or reflective surfaces and very large stacks (20+ frames can slow it significantly).
Adobe Lightroom / Camera Raw (Focus Merge)
Select your stack frames in Lightroom, right-click β Photo Merge β Focus. Simpler workflow than Photoshop, good results for straightforward subjects. Less control over the blending algorithm than dedicated software.
Helicon Focus
The dedicated standard for serious macro and scientific work. Three blending methods:
Method A β Weighted Average
Averages sharpness across frames. Good for smooth surfaces and gradual focus transitions. Tends to produce slightly softer results on fine detail.
Method B β Depth Map
Builds a depth map then selects the sharpest pixel from the appropriate layer. Excellent for most macro subjects β the default starting point. Handles fine hair and bristle detail well.
Method C β Pyramid
Multi-scale frequency blending. Best for highly detailed subjects with fine texture. Can show halos on high-contrast edges β use Radius and Smoothing controls to manage this.
Zerene Stacker
Helicon's main competitor, preferred by many entomologists and scientists for its handling of difficult subjects with fine translucent structures (insect wings, spider silk). PMax algorithm is particularly effective for these cases. Retouching tools allow manual correction of blending errors directly in the software.
Common Problems and Fixes
| Problem | Cause | Fix |
|---|---|---|
| Blurry zone between sharp areas | Step size too large β gap between focal planes | Reduce step size, reshoot with more frames |
| Subject appears to grow/shrink across stack | Focus breathing β lens changes magnification as focus shifts | Use focus rail (moves camera, not focus) or enable magnification correction in software |
| Halos around edges | High-contrast edges between layers | Reduce Radius in Helicon Method C; switch to Method B |
| Ghosting on moving elements | Subject or background moved between frames | Shoot faster (in-camera bracketing); mask moving elements manually in post |
| Colour shift across stack | Flash colour temperature drift or ambient light change | Use continuous lighting; match white balance in RAW before stacking |
| Misalignment between frames | Camera moved between shots | Use sturdier tripod; heavier camera plate; enable auto-align in software |
Focus Breathing: The Macro Stacker's Enemy
Many lenses change their effective focal length as focus distance changes β a phenomenon called focus breathing. In video this causes a zoom-like effect during focus pulls. In macro stacking it causes each frame to be slightly different in magnification, creating a growing or shrinking effect across the stack that software must correct.
Using a macro rail instead of the focus ring eliminates focus breathing entirely β you're moving the whole camera, not adjusting internal lens elements. The magnification stays constant across all frames. This is why dedicated macro photographers prefer rails despite the slower workflow. In-camera focus bracketing systems on modern cameras often include magnification correction algorithms to compensate for this automatically.
How Many Frames Do You Need?
| Subject / Scenario | Typical Frame Count | Method |
|---|---|---|
| Flower at 1:2 (half life size) | 5β10 frames | In-camera bracketing, step 3β4 |
| Insect at 1:1 | 15β30 frames | In-camera bracketing, step 1β2 |
| Insect at 2:1 (2Γ life size) | 40β80 frames | Macro rail, fine increments |
| Landscape foreground + background | 2β4 frames | Manual focus ring |
| Product shot (10cm object) | 10β20 frames | In-camera bracketing, step 2β3 |
| Mineral / crystal specimen | 20β50 frames | Macro rail |
Landscape Focus Stacking: The Simple Version
Landscape stacking doesn't require macro-level precision. The typical workflow is two or three frames:
- Frame 1 β foreground: Focus on the nearest element, typically 30β80cm away
- Frame 2 β background: Focus at or beyond hyperfocal distance for the background
- Optional Frame 3 β midground: If there's a significant gap between near and far
Blend in Photoshop Auto-Blend or manually β paint a layer mask to reveal the sharp foreground from Frame 1 over the sharp background from Frame 2. With a clean sky and static scene, this takes five minutes in post and produces a result no single exposure can match.
β οΈ Wind Is the Landscape Stacker's Problem
Moving vegetation between frames creates ghosting that's very difficult to fix in post. Shoot at sunrise or early morning when wind is typically calmest. Alternatively, use fast enough shutter speeds to freeze the movement β but then you'll need to manage exposure changes across the stack carefully.
When Not to Focus Stack
Focus stacking is powerful but not always the right answer:
- Moving subjects β any subject that moves between frames will ghost. Wildlife, moving water, people
- Handheld shooting β misalignment between frames is too large for software to correct reliably
- When shallow DOF is the creative intent β stacking eliminates bokeh. If background blur is part of the image, don't stack
- When a single frame at f/8βf/11 already works β stacking adds complexity and processing time. Only use it when you actually need it
Final Thoughts
Focus stacking sits at the intersection of optics and computation β it solves a problem that physics alone can't. Once you understand why DOF fails at macro distances, stacking becomes an obvious and necessary tool rather than an exotic technique.
Start with in-camera focus bracketing if your camera supports it β it removes most of the complexity from the capture phase. Use Photoshop for moderate stacks, Helicon Focus or Zerene for serious macro work. And always check your DOF per frame before you shoot: knowing whether you need 8 frames or 30 changes how you approach the whole session.