C14 lesson 5 of 13 6 min read Advanced

Focus Stacking

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.

The question this lesson answersHow do you combine several frames with different focus into one image that is sharp from front to back?

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

Focus bracketing methods
MethodHowBest forNotes
Focus ringTurn the focus ring a little between framesClose-up and moderate macroChanges magnification slightly; software corrects small changes
Focusing railMove the whole camera forward in precise stepsHigh magnification and studio workKeeps magnification constant; motorised rails automate it
In-camera focus bracketingThe camera shifts focus automatically (often called focus bracketing or focus shift)Field and studio, with compatible lensesFast 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.

Example planning at 1:1 on full frame, f/8 (DOF about 1 mm)
Subject depthStep sizeApproximate frames
5 mm (small beetle)About 0.5–0.7 mmAbout 8–10
10 mm (flower centre)About 0.5–0.7 mmAbout 15–20
20 mm (watch, side view)About 0.5–0.7 mmAbout 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

  1. Use a stable support: tripod, copy stand or rail.
  2. Set manual exposure and white balance so every frame matches.
  3. Choose a sharp aperture, often f/5.6–f/8 at 1:1, as in depth of field at high magnification.
  4. Use consistent light: flash or steady continuous light, as in macro lighting.
  5. Start just in front of the nearest point and finish just behind the farthest point you want sharp.
  6. 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:

Common stacking methods
Method typeStrengthsWeaknesses
Pyramid (contrast-based)Excellent for hairs, bristles and overlapping fine detailCan increase noise and shift contrast or color slightly
Depth mapClean, natural tones on smoother subjectsMore 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

Stacking problems
ProblemCauseFix
Soft bands across the subjectSteps too largeUse smaller steps
Halos around edgesOut-of-focus foreground blurring over backgroundTry the other method, retouch from source frames
Ghosts or doubled partsSubject moved between framesShoot faster, block wind, remove bad frames
Flicker or brightness changesInconsistent light or auto exposureUse manual exposure and stable light
Blurred edges of frameMagnification change during focus ring stackingCrop 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?
Taking several photos with focus moved slightly each time and combining the sharp parts into one image.
How many photos do I need for focus stacking?
It depends on magnification and subject depth: a few for landscapes, around 10–40 for moderate macro, hundreds for extreme macro.
What aperture should I use for focus stacking?
A sharp aperture that avoids heavy diffraction, often around f/5.6–f/8 near 1:1.
Why does my focus stack have halos?
Out-of-focus edges spread over the background. Try another stacking method or retouch from individual frames.

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.

Related lessons

0 views