Skip to content
Omnikalc

Focus stacking calculator

Enter the aperture, the magnification, the circle of confusion, the depth of the subject and the overlap to get the depth of field of one shot, the focus step and the number of images to stack.

Updated on
Your inputs

Value out of range

×

Value out of range

mm

Value out of range

in

Value out of range

%

Value out of range

Results

Depth of field of one shot

0.672 mm

Focus step between shots

0.538 mm

Number of images to stack

19

Effective aperture
11.2
Diffraction blur (Airy disk diameter)
0.0150 mm
Diffraction blur as a share of the circle of confusion
50 %

The focus stacking calculator gives the depth of field of one shot in close-up photography, the focus step between images and the number of images to stack to cover a subject of a given depth, with the effect of diffraction at the chosen aperture.

How the calculation works

  • Enter the aperture, the magnification and the circle of confusion.
  • Enter the depth of the subject and the overlap between slices.
  • Read the depth of field, the step, the number of images and the diffraction blur.

Example

At f/5.6 and a magnification of 1 ×, one shot has a depth of field of 0.672 mm. With an overlap of 20 %, the focus step is 0.538 mm, and a subject 0.4 in deep needs 19 images. The effective aperture is 11.2, which gives a diffraction blur of 0.0150 mm, or 50 % of the circle of confusion.

Why it matters

The calculator helps macro photographers, product photographers and microscopists who stack images to keep an insect, a flower, a coin or a component sharp from front to back, and want to set a focusing rail or an automatic bracketing correctly.

Good to know

Use a circle of confusion that fits your sensor and your final use: 0.03 mm is the classic value for a full-frame camera, and a smaller one gives a stricter result. A tripod, a still subject and a focusing rail are needed, and a few more shots than the result protect the front and the back of the subject. The formula is an approximation for a symmetrical lens, and the real depth of field depends on the lens design. Stacking software will align the frames and correct the small changes of scale.

The field of view calculator gives the angles of a lens, the depth of field calculator covers general photography, the microscope calculator gives the magnification and the panorama calculator plans stitched images.

Frequently asked questions

Why stack images?

At high magnification, the depth of field is very small: less than a millimeter at 1:1 and f/5.6. Closing the aperture does not solve it, because diffraction then blurs the whole image. Taking several shots at different focus distances and merging the sharp parts gives a deep and sharp result.

How is the depth of field computed?

In close-up photography the total depth of field is about 2 × N × c × (1 + m) / m², where N is the f-number, c the circle of confusion and m the magnification. Doubling the magnification divides the depth of field by nearly four, and doubling the f-number doubles it.

What overlap should the slices have?

Each slice must overlap with its neighbors so that every part of the subject falls in the sharp zone of at least one image. An overlap of 20 to 30 percent is a safe choice. A subject with fine texture or a transparent one may need more, and a simple smooth one can use less.

Which aperture is best for stacking?

A medium aperture, near the sharpest for the lens, gives the best detail. The diffraction blur, about 2.44 × wavelength × effective aperture, must remain small compared with the circle of confusion. Beyond f/11 at 1:1, diffraction is already visible. The effective aperture is N × (1 + m).

Was this calculator helpful?

Thanks for your feedback!

Results are estimates provided for information purposes. They do not replace professional advice.