*Note: this is Part 2 of a series on depth of field. Click here for part 1, which explains the relationship between aperture size and depth of field.)*

Besides using aperture size, photographers can also control depth of field by changing the camera-to-object distance or the lens focal length. Specifically:

- For a fixed focal length and aperture size, increasing the object distance will increase the depth of field.
- For a fixed object distance and aperture size, increasing the focal length will decrease the depth of field.

These two effects are closely related, and the quest to understand them offers a great example of how we can use equations to augment our intuition while solving relatively complicated problems. Read on if you want to learn more!

# A Little Review

Before we get to the heart of this post, we need a quick review of the factors that determine depth of field. In my previous post about aperture size and depth of field, we saw that a point object produces a circle (the *circle of confusion*) on the camera sensor when the sensor is not exactly located at the image position. When the circle of confusion is “small enough,” we say that the object is in *approximate focus*. There is a range of image positions surrounding the sensor that all produce circles that are small enough to be in approximate focus. We can refer to the width of this range as Δd_{i,acceptable}. Likewise, there is a corresponding range of object positions that produce images within this range. The width of the range of object positions is called the *depth of field* (DOF). These ideas are illustrated in the figure below:

# Building Intuition with Lens Diagrams

Let’s first consider the relationship between depth of field and object distance. To begin, let’s take a look at some ray diagrams that illustrate what happens as we increase the distance between the object and the lens for a fixed focal length. We’ll move the object twice (by the same amount each time) and see how the image changes:

We can make two important observations based on these diagrams:

- As the object moves farther from the lens, the image moves closer to the lens and decreases in size. As a result, the angular size of the bent light cone increases. In my previous post, we saw that a wider bent light cone decreases Δd
_{i,acceptable}. Let’s refer to this as the*angular effect*. - Even though the first and second object shifts are the same size, the second
*image*shift is smaller than the first image shift. In other words, the image position is less sensitive to the object position when the object is farther from the lens. In this case, a specific Δd_{i,acceptable}should correspond to a larger range of object positions. Let’s refer to this as the*sensitivity effect*.

# The Tricky Part of the Problem

So what does this mean for the DOF? The answer to this question is not very straightforward because we have two competing forces. As the object moves farther from the lens, the angular effect decreases Δd_{i,acceptable} to a smaller value. However, the sensitivity effect means that this smaller Δd_{i,acceptable} corresponds to a larger DOF than it would have at the original object position. Depending on the relative strengths of the angular and sensitivity effects, the DOF might decrease or increase!

To proceed any further, we will need to quantitatively determine the depth of field for different object distances. For a lens with a given focal length, the general procedure would be as follows:

- Choose a central object position.
- Determine the corresponding image position.
- Assume that the camera sensor is located at this position.
- Choose another object position, locate its corresponding image, and determine the size of the circle of confusion it produces.
- Repeat step 4 many times to find the object positions at the extreme edges of the approximate focus range. This will determine the depth of field at this central object position.
- Repeat steps 2-5 many times for different central object positions.

It is possible to do this graphically by drawing bazillions of ray diagrams. However, it is much easier to calculate the depth of field numerically using equations that describe a simple model of a lens. Let’s do that instead!

# The Thin Lens Equation

The *thin lens equation* is the key to numerically determining the depth of field. If you’ve taken a physics class before, you’re probably pretty familiar with it. For a point-sized object that is radiating light towards a lens, the equation relates the object-to-lens distance (d_{o}), the image-to-lens distance (called d_{i}), and the lens focal length (called *f*) in the following way:

.

Strictly speaking, this equation only applies to idealized lenses that have zero thickness. Of course, such lenses do not exist in real life. However, camera lenses are carefully designed so that they function almost exactly like perfect thin lenses. We won’t be able to completely trust the exact values of the numbers we get from this equation, but we should be able to believe the general trends we uncover.

Note that the thin lens equation contains all of the information we learned from the ray diagrams I drew above. Specifically, we can use the thin lens equation to discover the angular and sensitivity effects. To do this, we can solve the equation for the image distance and then plot d_{i} vs d_{o} for a particular focal length, say 50 mm:

We can easily see that as the object position increases, the image position decreases towards the focal point. From this we can infer the angular effect. Additionally, we can see that the curve becomes flatter at larger object positions. From this we can infer the sensitivity effect. I have explicitly illustrated this by showing how the same Δd_{i,acceptable} can result in a larger DOF at larger object distances (smaller image distances).

# A Model for Depth of Field

Before we can numerically calculate the depth of field, we will need to determine the diameter of the circle of confusion (C) as a function of object position, focal length, aperture radius (A), and sensor position (S). The following diagram illustrates how these quantities are related, and also includes the object height (h_{o}) and image height (h_{i}):

First of all, we can find the diameter of the circle of confusion using θ_{1}, θ_{2}, d_{i}, and S:

Next, we can find the angles using A and h_{i}:

When we combine these three equations, the image height actually cancels out:

.

As the final algebraic step, we can find the image distance using the thin lens equation. When we combine everything together, we can get a big ugly equation for C. Don’t worry, I only wanted to give an outline of how to do this — I won’t bore you with the details of the algebra!

Now that we know how to find C, we can choose S, A, and *f* and calculate C for various object positions. For example, we could imagine using a 55 mm lens to take a picture of an object located 10 feet from the camera lens. A typical aperture radius is around 1 inch. The following graph shows the diameter of the circle of confusion for various nearby object positions:

I use a Pentax K10D camera. Its sensor has 10.75 million pixels that are situated on a rectangle that is 23.5 x 15.7 mm. We can therefore estimate that each pixel is about 5.9 μm across. If we choose 6 μm as our threshold value for the maximum circle diameter, we can find the depth of field to be about 1.7 inches across.

Finally, we can repeat this process many times for many different object distances to see how the depth of field changes:

Ultimately, we see that the depth of field increases when we increase the object distance. But actually, if we think about our previous analysis, we have learned something else: this means that the sensitivity effect is more important than the angular effect for determining the depth of field at different object distances.

# Focal Length and Depth of Field

We can reuse some of the same ideas to understand how focal length affects depth of field. Specifically, let’s use the thin lens equation to plot d_{i} vs d_{o} for different focal lengths:

From this graph, we can see that for larger focal lengths, the image distance changes more rapidly with object distance. In other words, the image position is more sensitive to the object position when the focal length increases. We know from our previous analysis that the sensitivity effect determines the depth of field, and that an increase in sensitivity should make the depth of field decrease. We can check this prediction by using our simple model to calculate the depth of field for different focal lengths. Again, let’s imagine using a camera to take a picture of an object that is 10 feet away. We’ll assume that the aperture radius is 1 inch and that the focus threshold is 6 μm.

Our original conclusion was correct — as focal length increases, the depth of field decreases!

# Conclusions

To reiterate what we did:

- We began by drawing a few ray diagrams for objects at different distances. This allowed us to identify two competing effects: the angular effect and the sensitivity effect.
- Next, we used the thin lens equation to make a numerical model that allowed us to calculate the depth of field for any combination of object position and focal length.
- By comparing these numerical results to the intuition we gained from the ray diagrams, we found that the sensitivity effect determines the overall behavior of the depth of field as we change object distance and focal length.

Note that if we had just gone right to the numerical model, we would not have understood that the sensitivity effect is the underlying cause for the behavior! This example illustrates the importance of combining intuition with calculations while trying to understand complicated problems.

So now we have determined three rules for manipulating depth of field:

- For a fixed focal length and object position, increasing the aperture size will decrease the depth of field.
- For a fixed focal length and aperture size, increasing the object distance will increase the depth of field.
- For a fixed object distance and aperture size, increasing the focal length will decrease the depth of field.

Of course, it’s hard to predict how the depth of field will change when we modify focal length, object position, and aperture size simultaneously. Nevertheless, these are useful relationships to know. I hope you can use them in your own photographic endeavors!

Thanks for this great series. It helped me a lot! I had one question…I’m confused as to how focal length increases the sensitivity effect of the object distance/image distance relationship. In my mind, an increased focal length would end up decreasing the size of the circles of confusion (keeping everything else constant), and therefore increasing DOF due to the angular size of the bent light cone decreasing as dictated in the diagrams for the image position and changing object position.

Hi Sam, sorry for my late response! What you said is correct: for a larger focal length, the image position increases and the angular size of the bent light cone decreases. As a consequence, the acceptable range of image positions will increase. However, when determining the DOF, we really care about the acceptable range of object positions. For a larger focal length, the image position becomes more sensitive to the object position. In other words, a small change in object position can create a large change in the image position. So even though the acceptable range of image positions increases with a larger focal length, the acceptable range of object positions decreases. That’s why the DOF will decrease when we increase the focal length. I hope this makes sense now! It’s also explained in further detail within the article.

Hi! Thanks! I have constructed a geometrical simulation of your model with C.a.R.– Compass and Ruler, a dynamic geometry free software for to show the DOF variation when varies the focal distance, the aperture, the sensor position or the diameter of the circle of confusion. Would you like you that I send you it?

That sounds pretty interesting, I have never heard of C.a.R. before! How can you send the files to me?

in your dof example with 55 mm lens, aperature radius ~ 1 in, and object distance from lens ~ 10 ft, what was your value for sensor distance (S) to calculate C for a range of provided d0?

or it looks like the assumption is that the image taken at object position of 10 ft is assumed to be where the sensor position is, and then a range of object positions around this position is used to calculate the diameter.

http://www.wolframalpha.com/input/?i=0%3D2*(x-55*3048%2F(3048-55))*((25.4*(55*3048%2F(3048-55))

Yes, this is correct. I assumed that the sensor was placed to perfectly capture an image of the object 10 ft away, and then calculated the circle diameter for other object positions