Focus Stacking Step Calculator
Plan macro focus-stacking rail steps from magnification, aperture, subject depth, overlap, and rail precision with frame counts and warnings.| Metric | Value | Detail | Copy |
|---|---|---|---|
| {{ row.metric }} | {{ row.value }} | {{ row.detail }} |
| Check | Status | Capture note | Copy |
|---|---|---|---|
| {{ row.check }} | {{ row.status }} | {{ row.note }} |
| Frame | Rail move | Focus plane | Sharp from | Sharp to | Note | Copy |
|---|---|---|---|---|---|---|
| {{ row.frame }} | {{ row.move }} | {{ row.position }} | {{ row.sharp_from }} | {{ row.sharp_to }} | {{ row.note }} |
| Aperture | Macro DoF | Rail step | Frames | Tradeoff | Copy |
|---|---|---|---|---|---|
| {{ row.aperture }} | {{ row.macro_dof }} | {{ row.rail_step }} | {{ row.frames }} | {{ row.tradeoff }} |
Introduction
At life-size magnification and beyond, a subject only a few millimeters deep can be thicker than the sharp band from a single photograph. A coin edge, circuit board connector, watch movement, seed head, or insect face may have important detail at several front-to-back positions. Focus stacking handles that limit by capturing a sequence of frames at different focus distances and blending the sharp parts into one composite.
The capture plan matters because macro depth of field is small and changes quickly. Magnification, aperture, circle of confusion, overlap, rail precision, and subject depth all affect how far the camera or lens can move between frames. A move that is safe at 1:1 can leave soft gaps at 2:1, while an overly conservative move can turn a short product stack into a slow pass with many redundant frames.
Several terms need to stay separate. Magnification describes how large the subject is on the sensor. Circle of confusion describes how much blur is still accepted as sharp for the intended viewing size. Overlap is the safety margin between adjacent sharp bands. Rail increment is the smallest movement the hardware can repeat, and subject depth is the front-to-back distance that must look sharp, not the width of the object in the frame.
| Planning factor | Why it changes the stack | Common mistake |
|---|---|---|
| Magnification | Higher magnification shrinks the usable sharp band very quickly. | Assuming a 2:1 pass can use the same step as a 1:1 pass. |
| Aperture | A smaller aperture increases depth of field, but effective aperture also rises in macro work. | Stopping down until diffraction softens the detail the stack was meant to preserve. |
| Circle of confusion | A stricter sharpness target accepts a smaller blur spot and needs smaller moves. | Planning for web display when the final use is a tight crop or large print. |
| Subject depth | The pass must cover the front-to-back zone that needs to look sharp. | Measuring the visible width of the object instead of the depth along the focus travel. |
| Rail precision | The programmed move has to be repeatable on the actual macro rail. | Rounding a tiny required step upward because the rail cannot move finely enough. |
Rail movement is usually preferred for high-magnification stacks because it keeps magnification more consistent than turning the lens focus ring, but it does not remove every source of error. Backlash, vibration, flash recycle time, subject motion, focus breathing, lens softness, and stacking software choices can still show up as halos, skipped detail, or soft slices in the final blend.
There is also an aperture tradeoff. Stopping down widens the estimated sharp band and can reduce the frame count, but macro effective aperture rises with magnification. A setup that looks efficient on paper can lose fine texture to diffraction, while a wider aperture may require more frames but preserve detail that the blend can use.
A useful stack plan gives a starting move, a frame count, and a warning about setups that deserve a short test stack. The number is not a promise of perfect sharpness; it is a way to avoid guessing before the subject, lighting, and rail are locked down.
How to Use This Tool:
Enter the shooting setup as it will be used on the rail, then read the plan against the warning rows before committing to the full capture pass.
- Choose a Setup preset for a starting point, or leave Custom setup selected when you already know the values. Presets fill the form but do not lock the fields.
- Set Magnification source. Use Direct ratio for known values such as 1:1, 2:1, or 5:1. Use From frame width when you photographed a ruler at the subject plane and can enter the measured frame width.
- Select Sensor format and Sharpness target. Screen, print-safe, critical crop, and custom CoC choices change the circle of confusion, so they change the computed macro depth of field.
- Enter Aperture, Overlap target, Subject depth, and Rail increment. Measure subject depth along the focus travel direction, and use the smallest move your rail can repeat reliably.
- Open Advanced only when needed. Settle allowance subtracts a safety amount from the theoretical step, Extra guard frames add coverage before and after the subject, and Rail direction changes the ledger labels without changing the coverage math.
- If Check the stack setup appears, fix the named value before trusting the result. The plan stops when the settle allowance is larger than the theoretical move, a required value is invalid, or the frame count is beyond the rendering limit.
- Use Stack Brief for the programmed rail step and main metrics, Capture Checks for warnings, Step Ledger for frame positions, Aperture Ladder for aperture tradeoffs, and Coverage Path for the focus-plane graph.
Interpreting Results:
Programmed rail step is the move to enter on the rail between frames. It starts from the macro depth of field, removes the requested overlap, subtracts any settle allowance, and rounds down to the rail increment when that can be done without making the move too large.
Frame count is the number of captures needed to span the subject depth, including guard frames when selected. Rail travel is the full movement across the pass. Effective aperture is a warning cue for diffraction because high magnification makes the working f-number higher than the lens setting alone.
- Blend-ready: the estimated rear coverage reaches the entered subject depth and no stronger warning has priority.
- Rail limit watch: the usable target step is smaller than the rail increment, so the hardware may be too coarse for the setup.
- Diffraction watch: effective aperture is high enough that a wider aperture should be tested if fine texture looks soft.
- Long stack: the frame count is high enough to plan lighting stability, power, subject stillness, and processing time.
- Coverage gap: the estimated rear sharp limit does not reach the subject depth; reduce the step, add guard frames, lower the settle allowance, or remeasure the depth.
A ready status is still only a planning result. Before critical work, run a short calibration stack and compare the Step Ledger and Coverage Path with the actual direction, rail motion, and visible detail in the test images.
Technical Details:
Macro stack spacing is based on the depth of field around each focus plane. At close range, magnification dominates the calculation. Raising magnification from 1:1 to 2:1 does more than halve the step, because the macro depth-of-field estimate divides by magnification squared.
The circle of confusion is the blur diameter treated as acceptably sharp on the sensor. A smaller circle of confusion represents stricter inspection and produces a smaller step. Sensor-format defaults supply common starting values, and the sharpness target tightens them for print-safe or critical-crop work.
Formula Core:
The calculation uses millimeters after values are normalized. When magnification is derived from a ruler image, the ratio is sensor width divided by measured subject-space frame width.
| Symbol | Meaning | User-facing source |
|---|---|---|
| m | Magnification ratio, such as 1 for 1:1. | Magnification ratio, or sensor width divided by measured frame width. |
| N | Nominal lens f-number. | Aperture. |
| c | Circle of confusion in millimeters. | Sensor format and sharpness target, or custom CoC. |
| O | Requested overlap between adjacent sharp bands. | Overlap target. |
| A | Rail settle allowance in millimeters. | Settle allowance, converted from um. |
For a full-frame print-safe 1:1 setup at f/8, the circle of confusion is 0.029 mm multiplied by 0.75, or 0.02175 mm. The macro depth of field is therefore about 0.696 mm. A 30% overlap leaves 70% of that band, giving a theoretical 0.4872 mm move. With a 5 um rail increment, the programmed move rounds down to 0.485 mm.
Frame count is the subject depth divided by the programmed move, rounded up, plus one frame and any guard frames at both ends. The first focus plane starts before zero when front guard frames are used. Front and rear sharp limits are estimated by adding half the macro depth of field around each focus plane.
| Output or warning | Rule | What to verify |
|---|---|---|
| Rail rounding | When the rail increment is positive and smaller than the usable step, the step rounds down to the nearest increment. | Confirm the rail can repeat that move without backlash or overshoot. |
| Coverage | Rear sharp limit minus subject depth gives the coverage margin. | Positive margin is preferred; negative margin means the pass ends too soon. |
| Diffraction | Effective aperture at f/22 or higher is watched; f/32 or higher is reviewed more strongly. | Inspect fine texture in a test stack before relying on the smaller aperture. |
| Overlap | Less than 20% overlap is aggressive; more than 55% overlap is heavy. | Low overlap risks gaps, while high overlap increases capture and processing time. |
| Stack length | More than 80 frames needs management; more than 180 frames is treated as long. | Check flash recycle, battery life, subject stability, and storage before starting. |
The model is a practical macro planning estimate, not a full optical simulation. Pupil magnification, lens design, focus breathing, diffraction response, subject texture, stacking algorithm, and display size can shift real-world results. Rounded display values are intended for readable planning; the actual capture should still be tested under the same rail direction, aperture, lighting, and magnification.
Accuracy Notes:
The calculator estimates rail spacing for static macro subjects from typed camera, lens, rail, and subject measurements. It does not inspect image files, predict blend artifacts, or replace a calibration stack.
- No photo file is uploaded or analyzed. The plan uses numeric setup values entered on the page.
- Keep magnification, aperture, camera position, lighting, rail direction, and subject support unchanged between the plan and the real capture.
- Measure depth along the focus travel direction. Angled or curved objects may need more coverage than their visible front outline suggests.
- Use Capture Checks as warnings, not verdicts. A diffraction or rail warning should lead to a test stack before a long final pass.
Worked Examples:
Product macro at 1:1. With the Product macro 1:1 preset, full-frame print-safe sharpness, f/8, 30% overlap, 6 mm subject depth, and a 5 um rail increment, Programmed rail step is about 0.485 mm. Macro depth of field is about 0.696 mm, Frame count is 14, Rail travel is about 6.305 mm, and Effective aperture is f/16. The Coverage check is ready with a rear margin of about 0.653 mm.
Insect detail at 2:1. With APS-C critical-crop sharpness, f/5.6, 40% overlap, 3 mm subject depth, and a 2 um rail increment, Programmed rail step is 0.050 mm and Frame count is 61. The much smaller step comes from magnification squared in the macro depth-of-field formula, not from the subject depth alone.
Extreme macro at 5:1. A Micro Four Thirds critical-crop setup at f/4, 45% overlap, and 1.2 mm subject depth gives a Programmed rail step near 0.007 mm and a Frame count of 173. Capture Checks should be read carefully because the pass is long and Effective aperture reaches f/24.
Rail increment warning. If the usable target step is 8 um but Rail increment is 20 um, Rail increment can show Too coarse. Reducing overlap may lower the frame count, but it also raises gap risk. A finer rail, lower magnification, or a tested wider aperture is safer than rounding the step upward without verification.
FAQ:
Should I enter magnification directly or use measured frame width?
Use direct magnification when the reproduction ratio is known. Use measured frame width when you can photograph a ruler at the subject plane; the calculator derives magnification from the selected sensor width and the width visible in the image.
Why does the frame count rise so fast at high magnification?
Macro depth of field is divided by magnification squared. Moving from 1:1 to 2:1 can require much smaller rail moves, and 5:1 setups often need very small steps even for shallow subjects.
Does a smaller aperture always improve the stack?
No. A higher f-number increases macro depth of field and can reduce Frame count, but Effective aperture also rises with magnification. Check the Diffraction row before assuming f/16 or f/22 is better.
What does a coverage gap mean?
A coverage gap means the estimated rear sharp limit does not reach Subject depth. Raise overlap, lower settle allowance, add guard frames, use a finer rail increment, or remeasure the subject depth.
Why does the setup error mention settle allowance?
Settle allowance is subtracted from the theoretical step. If it is equal to or larger than that step, there is no usable rail move left, so the plan cannot produce a trustworthy frame count.
Does the calculator upload my photos?
No. It does not need image files. It uses camera, rail, and subject measurements typed into the form, so final sharpness still has to be checked with real frames.
Glossary:
- Focus stack
- A sequence of frames focused at different front-to-back positions and blended into one image.
- Magnification ratio
- The subject image size on the sensor divided by the subject's real size, such as 1:1 or 2:1.
- Circle of confusion
- The blur diameter treated as acceptably sharp for the selected sensor format and final viewing target.
- Macro depth of field
- The estimated sharp band around one focus plane at the entered aperture, circle of confusion, and magnification.
- Effective aperture
- The working f-number after magnification is considered, used as a warning cue for diffraction in macro work.
- Rail increment
- The smallest repeatable movement your macro rail can make between frames.
- Guard frame
- An extra frame before the front point or after the rear point to add coverage margin at the ends of the stack.
References:
- D850 Tips: Focus Stacking, Nikon Professional Services.
- DoF 4.0 Reference Manual, Digital Light & Color.
- Focus Stacking Tutorial, Cambridge in Colour.
- Macro Camera Lenses, Cambridge in Colour.
- Effective Aperture and Macro, B&H eXplora, February 16, 2021.