Home › Techniques

Focus stacking

8 min read · Updated
Focus stacking
Image: Basile Morin, CC BY-SA 4.0 · Wikimedia Commons

In short

  • Focus stacking merges several frames, each focused at a different distance, into one image sharp from front to back.
  • It beats stopping down very far, which costs sharpness through diffraction.
  • Each step should overlap the previous zone of sharpness; macro needs many small steps, landscapes only a few.
  • Keep camera, light and subject as still as possible, then merge with dedicated or editing software.

What focus stacking is

Focus stacking is a technique in which you take several photos of the same scene, each focused at a slightly different distance, and blend the sharpest parts into one image. It gives depth of field that a single exposure cannot reach without heavy diffraction. It is widely used in macro, product and landscape photography.

The limit it solves is physical: depth of field gets very thin at close distances, often only a few millimetres or less, even at f/11.

Closing the aperture further is tempting, but beyond roughly f/11–f/16 on many cameras, diffraction starts to soften detail (approximate). Stacking keeps the lens near its sharpest aperture.

When to use it

In macro, it lets an insect, flower or coin be sharp from front to back while the background stays soft.

In landscapes, it keeps both a nearby rock or flower and distant mountains sharp when hyperfocal focusing is not enough, for example with a wide lens very close to the foreground.

For products and food, it delivers full sharpness under controlled studio light.

Choosing the focus steps

Each frame's sharp zone should overlap the next one slightly, so no soft band appears in the final image. Work from the nearest point to the farthest, or the other way, without skipping.

For landscapes, two to five frames are often enough: one on the foreground, one in the middle and one at the distance (approximate).

In macro, you may need dozens or even more than a hundred frames at high magnification, with tiny steps. Some cameras have a built-in focus bracketing mode that moves the focus automatically; a focusing rail that moves the whole camera is another option.

A good working aperture is usually around f/5.6–f/8, where many lenses are sharpest (approximate).

Keeping everything still

Use a solid tripod, a remote or timer, and if possible the electronic shutter to avoid vibration. Set exposure, white balance and focus manually so they do not change between frames.

The subject should not move. Wind is the enemy outdoors; early mornings are calmer, and insects are less active when cool.

Light should stay constant. Changing clouds or a flash that does not recycle in time produce frames that do not match.

Merging the stack

Stacking software aligns the frames, finds the sharpest area in each and blends them. Many general photo editors include a stacking function, and dedicated programs offer more control for large macro stacks.

Most programs offer different blending methods. One is usually better for fine detail like hairs, another for smooth surfaces; trying both is worthwhile.

Check the result at 100 %. Look for halos around edges, soft bands and smeared areas where something moved, and retouch them from single frames if needed.

Common mistakes

Too few frames leave soft bands between the sharp zones. If in doubt, take more frames with smaller steps.

Focus breathing, a slight change in framing as focus moves, is normal and corrected by alignment, but very strong breathing can crop the edges.

Moving subjects and changing light produce ghosts that are hard to fix. Shoot fast or wait for calm.

An exercise to try

Place a small object, such as a pine cone, on a table near a window. With the camera on a tripod at f/8, take frames from the nearest tip to the back, turning the focus ring a little each time.

Merge them and compare the result with a single frame at f/22. Look at both detail and overall sharpness.

Frequently asked questions

How many photos do I need for a stack?

It depends on magnification and aperture. Landscapes often need two to five frames; close macro can need dozens or more (approximate).

Which aperture should I use?

Usually the lens's sharpest range, often around f/5.6–f/8 (approximate). Smaller apertures mean fewer frames but more diffraction.

Can I focus stack handheld?

For a few frames in bright light, sometimes, because software can align them. For macro and precise results, a tripod is far more reliable.

Is focus stacking cheating?

It is a widely accepted technique. In competitions and documentary contexts, check the rules and disclose it where required.

Sources

Keep reading