Guide
How to focus stack
Focus stacking is taking several photographs of the same scene at different focus distances and merging the sharp parts of each into one picture. This page is the shooting half; the stacker is the merging half.
What focus stacking is, and what focus bracketing is
Focus bracketing is the shooting: a series of frames where the focus moves a step between each. Focus stacking is the merging: software chooses, for every region of the picture, the frame in which that region was sharpest, and assembles one image from the winners. You need both. Many cameras will bracket for you (Canon's R series, Nikon Z, OM System, Fujifilm and Sony all offer it under names like focus bracketing or focus shift); the merging is what this site does.
Why not just stop down? Because diffraction softens everything past about f/11 on a full-frame sensor, and at macro magnifications the depth of field at f/11 is under a millimetre anyway. Stacking gets you a sharp beetle at f/5.6 where the lens is at its best.
lens, left one frame's depth of field, three frames subjectstep ≤ DoF × 0.7
How to shoot a series that will merge
- Tripod, or a rail. The frames must show the same framing. Hand-held brackets can be stacked, but every millimetre of movement is a millimetre the aligner has to undo, and it can only undo so much.
- Manual exposure, manual white balance. A frame that is a third of a stop brighter than its neighbours shows up as a patch in the merge. Lock everything that can drift.
- Step size smaller than the depth of field. Each frame's zone of sharpness must overlap the next one's by about a third, or the merge has a soft band between slices. The calculator gives the step and the frame count for your aperture and magnification.
- Start in front of the subject and end behind it. The first and last frames should be slightly out of focus everywhere; a stack that starts on the subject has nowhere to put the foreground.
- One go, no wind. Anything that moves between frames — a leaf, a leg, a cloud's shadow — becomes a ghost. Indoors, switch the fan off.
- Aperture around f/5.6–f/8 on full frame, f/4–f/5.6 on smaller sensors; wide enough to avoid diffraction, narrow enough that each slice is usefully deep. At high magnification, effective aperture grows with magnification, so open up.
How many frames?
Macro at 1:1 and f/8 on full frame has a depth of field of about 0.6 mm per frame. A 12 mm insect therefore needs around 30 frames at a 0.4 mm step. Landscape stacks are the opposite: three to five frames from the near foreground to the hyperfocal distance are usually enough. The calculator does the arithmetic for your numbers.
The five things that break a stack
- Focus breathing. The lens changes its effective focal length as it focuses, so each frame is slightly larger or smaller than the last. The stacker corrects for it, but the correction costs a crop at the edges — leave room in the frame.
- Movement. Covered above; the only cure is reshooting.
- Too big a step. A soft band at a particular depth. Reshoot with a smaller step, or accept it.
- Overlapping edges at different depths. A hair in front of a leg: the hair is sharp in one frame, the leg behind it in another, and the merge has to choose. This is the classic halo, and it is why dedicated desktop stackers have a retouching brush. This site does not yet; see the limits on the stacker page.
- Mixed exposure. A brighter frame wins the vote where it should not. Lock exposure.
What to do with the series
Export the frames at full size — JPEG is fine, and it is what most bracketing modes produce anyway — and drop them on the stacker. The page aligns them, merges them and shows the result at 100 % so you can judge it the way you will judge it later.