Every slice sharp, no gaps
Focus positions that cover a range from front to back, spaced by the depth of field at each step rather than evenly — because depth of field grows with distance and even spacing leaves holes.
Focus stacking planner
Nothing leaves this device
How the steps are placed
Each frame's depth of field is computed with the same engine as the depth of field calculator. The next focus point is set so its near limit falls inside the previous frame's far limit by the overlap you chose, and the process repeats until the far target is covered.
The steps therefore get wider as focus moves away, because depth of field grows with distance — roughly with its square. A planner that spaced steps evenly would waste frames at the far end and leave gaps at the near end, which is the failure that shows up as a soft band across the middle of a stack.
These are focus distances, not rail positions. A focusing rail moves the whole camera; a lens that extends as it focuses does not move the same amount. If you work with a rail, use these figures as a frame count and a sanity check, not as millimetres to dial in.
Why not just stop down?
Because past a point diffraction takes away more than depth of field adds. On full frame that point is somewhere around f/11 to f/16; on Micro Four Thirds it arrives at f/8. Stopping to f/22 gives you a deeper zone in which nothing is quite sharp — the numbers on this page keep improving because the model does not include diffraction, but your pictures will not.
Stacking sidesteps the trade entirely: shoot each slice at the lens's best aperture and let software assemble them. That is why macro and product photographers stack rather than stopping down, and it is why the frame count here rises so sharply when you open up.
Shoot a few more than this says
Add one or two frames beyond each end. The stacking software needs a fully out-of-focus neighbour at the boundaries to blend against, and the alternative is a hard edge exactly where the subject meets the background. It costs two frames and saves a reshoot.
What moves between frames
Magnification. As a lens focuses closer the image grows slightly, so frames are not the same scale. Good software handles the alignment; it is why stacking a hand-held sequence sometimes fails where a tripod sequence succeeds.
The subject. Flowers move in air currents you cannot feel, and insects move for their own reasons. Outdoors, a stack of forty frames is often a stack of forty slightly different subjects. This is the real limit on stacking in the field, not the arithmetic.
The light. Continuous light drifts as cloud passes. Flash is more consistent but has to recycle between frames, which lengthens the sequence and gives the subject more time to move.
Related
Depth of field for a single frame, and macro calculator for the light you lose at magnification.
Questions people actually ask
How many frames do I need for a focus stack?
It depends on aperture, focal length and how close you are, which is what this page works out. As a feel: a flower at 50cm with a 100mm at f/5.6 needs a handful; the same subject at 1:1 magnification can need fifty or more, because depth of field at life size is under a millimetre.
Why are the steps not evenly spaced?
Because depth of field grows with distance, roughly as its square. A frame focused at 50cm covers a much thinner slice than one focused at 80cm, so the steps have to widen as you move back. Even spacing either wastes frames at the far end or leaves gaps at the near end — and a gap shows as a soft band through the middle of the finished stack.
Should I stack or just stop down?
Stop down first if it gets you there — one frame beats forty. But past roughly f/11 on full frame, diffraction softens the whole image faster than depth of field deepens it, so you gain a thicker zone in which nothing is properly sharp. Stacking lets you shoot every slice at the lens's sharpest aperture instead.
Do these distances work with a focusing rail?
Not directly. These are distances from the lens; a rail moves the camera, and on a lens that extends while focusing those are different quantities. Use the frame count and the step pattern as a guide, then set the rail by its own scale — or use a rail calculator that works in magnification.
What overlap should I use?
20 to 30%. The overlap is insurance: it means a slightly missed step still leaves the slices touching. Push higher for handheld work or a subject that may drift, and lower only when the camera is locked down and nothing is moving.