# Invariants in subject size and depth of field? [duplicate]

I was curious if I could cheat my way around having to focus stack an object by using different lenses. Playing with the Depth of Field calculator I noticed something interesting: No matter what focal length I select the depth of field for the same angle of view (at the subject) is constant.

For example, fixing sensor format at APS-C, aparture at f/22, and a supposing I need a distance from subject of 2m for a 300mm lens I get a depth of field of 3cm. I get the same DoF with a 600mm lens at 4m, 150mm at 1m, and 75mm at 0.5m.

Is this a quirk of practical lenses (or of that calculator), or is there a theoretical constraint here, and if the latter can someone show the math and theory?

Update: To clarify some potential confusion in the first paragraph, the question may be restated as follows: Given a fixed sensor, object, aperture, and magnification, is it possible to vary Depth of Field by varying lens focal length?

• You will probably find this answer satisfying since it explains it methodically using math.
– Hugo
Sep 16, 2014 at 14:53
• What you've discovered is fundamentally true, not just a quirk of the calculator. See here for a practical example: luminous-landscape.com/tutorials/dof2.shtml Sep 16, 2014 at 15:50
• @mattdm: Cool, that link is the answer! Do you want to post? If not I'll do it as community wiki. Sep 16, 2014 at 16:34
• @feetwet Go for it. It's kind of a "classic" post — it's at least a decade old, and it made all of the forum rounds back then. :) Sep 16, 2014 at 16:43
• I've found this more interesting than I thought. Upvoted! Becuase now I'm thinking of a cube, say 10cm³ and then 100cm­³ at the same distance from the sensor, if the DoF will look the same? If you printed them out? BUT, it would physically be different?? This is getting interesting... Sep 18, 2014 at 13:38

You are simply making the wrong assumptions. Just "playing around" and thinking you see a correlation doesn't mean that it actually exists. You've just fixed the sensor format at APS-C, aperture at f/22 and tried varying the focal length and subject distance a bit and thought that you saw a correlation.

However if you try these settings for example: f/2.8, Canon 1ds mk II, 12 mm and 0.5 m. You will get a total DOF of 0.31 meters. Change the settings to f/2.8, Canon 1ds mk II, 1200 mm and 50 m and you will get a total DOF of 0.29 meters.

The presumption that the DoF doesn't depend on the subject distance divided by the focal length isn't correct. You can further convince yourself of this by looking at this excellent answer by jrista, by looking at the Wikipedia article about DoF or by simply look at the formulas used by the Depth of Field calculator to calculate the DoF. They all cover or derive from the same formula albeit to different degrees of approximation:

See the various sources cited above for its explanation.

• ... for example: f2.8, Canon 1ds mk II, 12 mm and 0.5 m. You will get a total DOF of 0.31 meters. Change the settings to f2.8, Canon 1ds mk II, 12 mm and 0.5 m and you will get a total DOF of 0.29 meters. What the... Did you just use the same things and get a different result? Thanks insanity! Sep 18, 2014 at 13:00
• @BBking that was just a typo. It is corrected now.
– Hugo
Sep 18, 2014 at 13:02
• Oh... I see. Also, it was a joke. :) and Thanks = That's. Insanity; Doing the same thing (over and over) and expecting different results. Sep 18, 2014 at 13:14
• While it may not be absolutely true that DOF is independent of focal length for a given subject size, the fact that you've changed the focal length by 100x (10,000%) and got only a 6% change in DOF means it's pretty close to independent - and probably close enough to count as independent in a lot of practical uses. Sep 18, 2014 at 13:35
• @PhilipKendall Yes, it is definetly a good approximation. The question was about the DoF in theory though and I answered that. I absolutely agree with you though that it is good enough for a lot of practical uses.
– Hugo
Sep 18, 2014 at 13:40

Firstly, focus stacking is generally used for macro photography. So, you'll want to keep the camera in the same position to have consistent framing.

As mattdm has commented, you get different background compressions. The same thing when you use the same focal length, but different sensor sizes and subject distance.

Invariants in subject size and depth of field?

So, you have the an object of proportionally different sizes and you want to keep the subject distance the same?

So, a smaller object for a longer focal length and a bigger object for a shorter focal length? Yes, I guess this could work. Again, I think there would be background compression issues here.

Depends of the object, really. And you would want to keep things pretty consistent if you wanted to focus stack.

EDIT: Yes. The DoF would be more on a longer focal length and less on a shorter focal length, keeping the aperture and subject distance constance. But it would be hard work to get an object of different sizes to look proportionally the same size in each frame.

• I think you misunderstood the question: Given a fixed sensor, object, aperture, and magnification, do some lenses offer greater DoF than others? The proposed invariant is, that holding the first four variables constant, there is no way to alter the DoF. Sep 18, 2014 at 15:53
• Sorry, but you never said Given a fixed sensor, object, aperture, and magnification, do some lenses offer greater DoF than others? in your question. Invariants in subject size and depth of field? So, seeing as you said No matter what focal length I select the depth of field for the same angle of view is constant. you ARE NOT keeping the focal length constant. If you are changing the focal length and you want to keep the the field of view constant, you have to change the subject distance or subject size... Sep 19, 2014 at 3:38
• Exactly: To keep magnification constant every time I change to a different focal length I change the distance to subject proportionally. I see how saying "angle of view constant" is confusing; I meant angle of view at the subject, or magnification constant. The example @mattdm found at luminous-landscape.com/tutorials/dof2.shtml shows what I meant. (This is not to say that the question you're addressing isn't interesting; in particular the way you posed it in the comments -- thinking of proportional volumes. Probably merits its own question.) Sep 19, 2014 at 13:45