Skip to content
Detalia
All guides

Updated · 4 min read

Focus stacking is a way to get more of a picture sharp than a single photo allows. You take several photos of the same scene, each focused a little further away, and software combines the sharp part of every photo into one image.

The problem: one photo, one sharp slice

Every lens focuses at one distance. Things a little nearer or further still look acceptably sharp, and that zone is called the depth of field. Stopping down the aperture (f/8, f/11, f/16) makes the zone deeper, which is why landscape photographers like small apertures.

Close to the subject, that trick runs out. At life-size macro, even f/16 gives you only about two millimetres of sharpness. Stopping down further makes the whole picture softer, because light spreads as it passes through a small opening (diffraction). An insect’s eye can be crisp while its legs and wings melt into blur.

Only the slice at the focus distance is truly sharp. Moving focus moves the slice through the subject.

How focus stacking works

Instead of forcing one photo to do everything, you take a series and let each one handle its own slice.

  1. Shoot a focus series

    Start with focus on the nearest point and move it a little further away for each frame until you reach the back of the subject. Many cameras do this for you, see focus bracketing.

  2. Line the frames up

    Moving focus makes the image grow or shrink slightly (focus breathing), and the camera may have moved a hair. The software scales, shifts and rotates every frame until they line up.

  3. Find what’s sharp

    For every small area of the picture, the software measures which frame shows the most detail there.

  4. Combine

    It joins those sharp areas into one picture, blending the seams so you can’t see where one frame ends and the next begins.

Each frame is sharp in one thin slice. The stack keeps the sharp part of every frame.

When to use it

  • Macro: insects, flowers, water drops, minerals. The classic use, because depth of field is tiny. See macro focus stacking.
  • Products and jewellery: catalogue images where every edge and label has to be crisp.
  • Landscapes: a flower at your feet and the mountains in the distance, both sharp. See landscape focus stacking.
  • Food and still life: a close, low angle across a table.
  • Microscopy and science: specimens far deeper than the microscope’s depth of field.

It’s less suited to anything that moves between frames: people, animals in action, trees in strong wind, flowing water. Small movements can be fixed afterwards. Large ones usually can’t.

What you need

  • A steady camera. A tripod is best. Handheld stacks are possible with short bursts, but alignment has more to correct.
  • A way to change focus in small steps. The camera’s focus bracketing mode, the focus ring, or a focusing rail that moves the whole camera.
  • Consistent exposure. Manual exposure, fixed ISO and fixed white balance, so frames match in brightness and colour.
  • Stacking software. It does the aligning and combining. See how to choose focus stacking software.

Focus stacking vs focus bracketing

The two terms get mixed up. Focus bracketing is the shooting: the camera takes the series while moving focus. Focus stacking is the combining, usually done on a computer. Some cameras can also stack in-camera, but they typically save only a JPEG, crop the edges and give you no way to fix mistakes. Most photographers bracket in camera and stack on the computer from the RAW files.

What can go wrong

The usual problems are soft bands where the focus steps were too big, halos around edges, see-through areas where a near object overlaps a far one, and doubled detail where something moved. All of them have causes you can avoid while shooting, and most can be repaired afterwards. See focus stacking artifacts.

Questions

Is focus stacking the same as HDR?
No. HDR combines photos taken at different brightness to keep detail in shadows and highlights. Focus stacking combines photos taken at different focus distances to get more of the scene sharp. The idea is similar, the goal is different.
How many photos do I need for a focus stack?
Anything from 2 or 3 for a landscape to several hundred for extreme macro. It depends on how deep the subject is and how thin each sharp slice is. Our guide to step size and aperture shows how to work it out.
Can I focus stack with a phone?
Some phones can lock focus and shoot a series, and a few apps support it, but the small sensor already gives deep focus at normal distances. Stacking matters most with larger sensors and close subjects.
Do I need a special camera?
No. Any camera where you can set focus manually works. A focus bracketing mode makes it faster and more precise, and most recent mirrorless cameras have one.