When depth of field is only a millimetre deep, there is no single aperture that makes a whole insect, watch or flower sharp without heavy diffraction. Focus stacking solves this by taking a series of photographs, each focused slightly deeper, and combining only the sharp parts into one image. It is the key technique of modern macro, product and scientific photography, and it is also used in landscapes. This lesson explains how to capture a stack, how many frames you need, how stacking software works and how to fix common problems.
What is focus stacking?
Focus stacking is a two-step technique: first focus bracketing, taking a series of frames with the plane of focus moved slightly between each; then stacking, using software that selects the sharpest areas from each frame and merges them. It overcomes the thin depth of field explained in depth of field at high magnification, while letting you use a sharp aperture that avoids strong diffraction.
Three ways to move focus
| Method | How | Best for | Notes |
|---|---|---|---|
| Focus ring | Turn the focus ring a little between frames | Close-up and moderate macro | Changes magnification slightly; software corrects small changes |
| Focusing rail | Move the whole camera forward in precise steps | High magnification and studio work | Keeps magnification constant; motorised rails automate it |
| In-camera focus bracketing | The camera shifts focus automatically (often called focus bracketing or focus shift) | Field and studio, with compatible lenses | Fast and consistent; check step settings and frame limits |
Tip:In-camera focus bracketing makes stacking accessible, but it still needs sensible step settings. Too large a step leaves soft bands between frames.
Step size and number of frames
Each step should move focus by less than the depth of field of one frame, so the sharp zones overlap. Many photographers aim for steps of roughly half to three-quarters of the depth of field.
| Subject depth | Step size | Approximate frames |
|---|---|---|
| 5 mm (small beetle) | About 0.5–0.7 mm | About 8–10 |
| 10 mm (flower centre) | About 0.5–0.7 mm | About 15–20 |
| 20 mm (watch, side view) | About 0.5–0.7 mm | About 30–40 |
Higher magnifications need far smaller steps and many more frames, sometimes hundreds. Landscapes may need only three to five. Err on the side of more frames; extra frames cost storage, missing ones cost sharpness.
Capturing a stack
- Use a stable support: tripod, copy stand or rail.
- Set manual exposure and white balance so every frame matches.
- Choose a sharp aperture, often f/5.6–f/8 at 1:1, as in depth of field at high magnification.
- Use consistent light: flash or steady continuous light, as in macro lighting.
- Start just in front of the nearest point and finish just behind the farthest point you want sharp.
- Use a remote or timer to avoid vibration.
How stacking software works
Dedicated stacking programs, as well as some general editors, align the frames, measure local sharpness and build the final image. Most offer two main approaches:
| Method type | Strengths | Weaknesses |
|---|---|---|
| Pyramid (contrast-based) | Excellent for hairs, bristles and overlapping fine detail | Can increase noise and shift contrast or color slightly |
| Depth map | Clean, natural tones on smoother subjects | More prone to halos and loss of detail at overlapping edges |
Advanced users often produce both versions and retouch: using the cleaner result for backgrounds and smooth areas, and the detailed result for fine structures. Dedicated tools also allow retouching from individual source frames.
Common artifacts and fixes
| Problem | Cause | Fix |
|---|---|---|
| Soft bands across the subject | Steps too large | Use smaller steps |
| Halos around edges | Out-of-focus foreground blurring over background | Try the other method, retouch from source frames |
| Ghosts or doubled parts | Subject moved between frames | Shoot faster, block wind, remove bad frames |
| Flicker or brightness changes | Inconsistent light or auto exposure | Use manual exposure and stable light |
| Blurred edges of frame | Magnification change during focus ring stacking | Crop slightly or use a rail |
Field stacking
Outdoors, insects move and wind blows. Many nature photographers shoot short, fast handheld bursts while rocking gently forward, or use fast in-camera bracketing, then stack a few frames. Results are less perfect than in the studio but capture living subjects naturally, as discussed in nature macro photography.
Common mistakes
- Steps too large: soft bands.
- Auto exposure between frames: brightness flicker.
- Too small an aperture: diffraction defeats the purpose.
- Not covering the whole depth: the front or back stays soft.
How professionals stack
Product and scientific photographers use motorised rails or automated bracketing, calculate step sizes, light consistently and stack in dedicated software, then retouch carefully. Nature photographers adapt with fast field techniques. All of them check stacks at full size for halos and seams before delivery. In scientific work, they also record the number of frames and steps, as in technical metadata and reporting.
Practical examples
A watch for a catalogue
- Situation
- At 0.5× and f/8, only part of the dial is sharp.
- What to do
- You use in-camera focus bracketing for 20 frames, steady LED light and manual exposure, then stack.
- Why it works
- Stacking extends sharpness without stopping down into diffraction.
- Result
- The whole watch is crisp from the bezel to the strap.
Halos around insect hairs
- Situation
- Your stack shows glowing halos around a fly's hairs.
- What to do
- You re-render with the pyramid method and retouch the background from the depth-map version.
- Why it works
- Each method handles different areas better.
- Result
- Clean hairs and a smooth background.
Key points
- Focus stacking combines frames focused at different depths into one sharp image.
- Move focus with the ring, a rail or in-camera focus bracketing.
- Steps should overlap depth of field; more frames are safer than fewer.
- Pyramid methods handle fine overlapping detail; depth-map methods give clean smooth areas.
- Fix halos, bands, ghosts and flicker with method choice, smaller steps and stable conditions.
Frequently asked questions
What is focus stacking?
How many photos do I need for focus stacking?
What aperture should I use for focus stacking?
Why does my focus stack have halos?
Conclusion
Focus stacking extends sharpness far beyond a single frame. Capture overlapping steps with stable light and exposure, choose the right stacking method, fix artifacts carefully and adapt for the field. Next, you will learn how to light macro subjects.
Finished reading? Track your progress through Macro and technical.