Points in Focus Photography

Focus Stack Calculator

This calculator computes the number of frames needed to make a focus stack with a focus shift specified in the focus step field that covers from the starting distance to the ending distance.

Please note, this calculator is still in beta and may not provide accurate results in all conditions.

Direct link

Usage

Distance Units
500 millimeters
500 mm millimeters
5m meters
30.6” inches
3’ feet
3.6’ feet
3’4” feet and inches

To use the calculator enter your lens’s focal length, the aperture you will be shooting at, whether or not you have the camera set to APS-C crop mode, the focus step size you’ve set, and the starting and ending distances for the stack you want to shoot.

Distances are a free form number that’s parsed by the script and can be specified in either feet, inches, feet and inches, meters, or millimeters. See the following table for examples

Assumptions and Theory

I’ve made two major assumptions in the development of this too. First relates to the size of the focus shift between images. Canon calls this “focus increment” on cameras such as the EOS R5. Nikon calls this “Focus step width” on cameras such as the Z6 II and Z7 II. My assumption at the present time is that the focus steps are equal to 1/8 of a depth of field.

I made this assumption for two reasons. First, 1/8 of a depth of field has historically been the size of the smallest AF increment available on Canon cameras. It’s what an AF micro adjustment step was, as well as the smallest shift you could make when remotely controlling the focus via Canon’s EOS Utility.

I’m fairly confident in the accuracy of this assumption, as in my testing a focus increment of 8 on my EOS R5 corresponds to a focus shift that’s approximately 1 depth of field deep.

The second assumption deal with the acceptable threshold for the depth of field. Namely I’m using the same standard that most camera manufacturer’s use when they calculate depth of field. This formula can be traced back to film photography and in some respects may be insufficient for modern high resolution digital cameras — at least in some applications.

With those assumptions in hand, I calculate the depth of field for the specified lens, aperture, crop size, and initial (close) focus distance. Then shift the focus position towards infinity by “focus step” × 1/8 of that depth of field. This process is repeated until either infinity is reached, 999 steps have been taken, or the specified far depth of field limit has been reached.

Comments

Wim Vanmaele

Hi,

I tried your webapp. It is not working.
I can’t choose an aperture. Dropbox doesn’t open, no value is selectable.

If needed, I can, will help you in coding this (if it is php)

Otherwise, nice thing to have, use.

    Jason Franke  | admin

    Sorry about that, boneheaded move on my part, I didn’t properly link a required JavaScript file for production.

    It should work now.

Wim Vanmaele

Sorry, but it is not working.
When I check the JS, no values are available in the combobox ‘Aperture’. Maybe there is a mistake in the name ? Using or not using a captial ?
On the HTML-page, normally, in a dropdown (select) possible options are added. They are missing here.

f/
select id=”aperture” class=”updtrig” name=”aperture” data-mini=”true” style=”width:5em”
/select

Should be:

select
option 1
option 2
…..
/select

    Jason Franke  | admin

    1) What browser are you using? (Try a different one if you have another installed.)
    2) Are you running a content/ad blocker? (I don’t actually care if you do, but make sure that it’s not blocking scripts from http://www.pointsinfocus.com, static1.pointsinfocus.com, or jquery from cdnjs.cloudflare.com)
    3) Have you flushed your browser’s cache and reloaded the page? (The HTML is the only thing that changed, and that shouldn’t be cached. Loading the page with the developer console open should also force the browser’s cache to be ignored.)

    The contents of the Aperture select box are generated by the JS doing the calculations. If it’s not generating then the odds are that there’s a JS error that’s causing the execution of the scripts to halt/fail to execute. Check your JS console, and see what warnings are showing up. Unfortunately, I can’t seem to reproduce the problem on my end, and I’ve tested the page in Chrome (win & macos), Edge, Firefox, and Safari (macos & ios).

    I’d like to get to the bottom of this if I can, as I do consider this to be in beta; so it’s possible that there’s a bug I’m simply not seeing and I’d like to fix that.

Ron

Thanks for the technical explanations and the tool, it appears to be working for me. One question I have is, Can the camera be used to drive a flash for each of the images? I think this would slow down the capture sequence.

    Jason Franke  | admin

    That would depend on the brand and specific camera, but you’re right firing the flash will significantly slow down the bracket shooting.

    Most Nikon cameras have the ability to fire the flash but require you to set a custom timeout (I believe the minimum is 1 second) between exposures. Canon’s mirrorless cameras simply don’t support using the flash and focus bracketing. I have no idea off hand what the situation is with Fuji, Panasonic or Sony.

    That said, you’d have to check your camera’s manual to be sure.

    Ron

    Ya, I have an R5. I think it is a neat new feature (for me), and I have been doing a lot of testing with it, planning for a shot. I might next look into some constant lighting. Thanks.

Ivan

You have black text set on a dark grey background. Very, very hard to read.

    Jason Franke  | admin

    Sorry about that. It was due to the way that the dark theme for the main site interacted with the iframe for the calculator. I’ve put in place a workaround for the time being that will always keep the calculator as black text on white.

bote de jong

Thanks for your work on this and other subjects. I’m trying to get wise about Fuji’s focus bracketing algoritm and your article helps a lot. However, in your “beta calculator” there is a box “add to above” which I don’t get. Ticking it increases ther numbere of exposures significantly, but I find no explanation of its why and how. Could you comment on this?

    Jason Franke  | admin

    The “add to above” box causes the second distance to be added to the first for the calculation instead of being used as is. When it’s ticked, you can think of it kind of it like specifying the depth of field you want captured in the second distance box.

    So if you need for example a focus stack from 1m to 6m, you can specify it 2 ways. First, you can set 1m and 6m as the two distances. Alternatively, you can set 1m as the first distance, and 5m with the add to above box checked as the second.

    bote de jong

    Clear. Thanks & regards, Bote

    Jason Franke  | admin

    That could be the result of a couple of things.

    One is that Nikon may use different “steps” than my calculator assumes. I assumed that steps are fractions of depth of fields, since that seems to be what Canon cameras use (as the focus distance changes change with different aperture settings and subject distances). If Nikon’s steps are just AF motor increments, that would result more images being needed to cover the same area. There is the comment in the article about problems with the step width when it’s greater than the depth of field, indicating that the step width may just be AF motor steps.

    Additionally, I used standard DoF calculations, which don’t always hold up well at macro magnifications. It’s entirely possible that Nikon’s using more accurate lens specific calculations that take into account the effective focal length changes due to both close focusing and focal length changes from internal/rear focusing designs to get more accurate numbers for those tables.

    That said, I’m not 100% sure any of this is 100% correct — none of the camera makers actually disclose exactly how their focus bracketing works and what the focus step setting is doing so everything has to be reverse engineered which is not error free. Additionally, I only have a limited amount of gear that I can test with, and what I came up with seemed to work for my Canon gear, but that’s not guaranteed to be universally true.

Leave a Reply

Basic Rules:
  • All comments are moderated.
  • Abusive, inflamatory, and/or "troll" posts will not be published.
  • Links to online retailrs (eg., Amazon, Ali Express, EBay, etc.) either directly, or indirectly through 3rd party URL shorternrs, will be removed form your post.
  • Extremely long comments (>1000 words) may be blocked by the spam filters automatically.
  • If your comment doesn't show up, it may have been eaten by the spam filters; sorry about that.
  • See the Terms of Use/Privacy Policy for more details.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Follow me on twitter for updates on when new comments and articles are posted.

Email Notice Details: By checking the above checkbox, you are agreeing to recieve one email at the email address provided with this comment, for the sole purpose of notifing you that the article author has been reseponded to your comment.

Our cookie and privacy policy. Dismiss