draft · v0.1.226
💬Comments welcome. To leave a note, select any text and click the note / highlight button that pops up — or open the panel with the tab at the top-right (‹). Notes are visible only inside our private review group.
💡 In a hurry? Jump to this chapter’s 5 big lessons ↓

2.9 Depth of field

Set a lens to focus on one plane, and objects exactly on that plane image sharply. Objects nearer or farther do not, and how much nearer or farther you can stray before the blur becomes objectionable is the depth of field (DoF). It is one of the photographer's main creative controls: a portrait with a melting, out-of-focus background, and a landscape crisp from the foreground flowers to the distant peak, are both choices about depth of field.

fig-dof-macro-extremes
Figure 2.9.1. Depth of field, the two extremes. The same 1:1 macro scene, the same 90 mm lens, the same spot, changing only the aperture: wide open ($f/2.8$) a razor-thin slice is sharp (shallow depth of field); stopped down ($f/22$) almost the whole receding row is sharp (deep depth of field). The aperture is depth of field's main control. Photographs by Frédo Durand.

2.9.1 The circle of confusion

Start with one out-of-focus point (Figure 2.9.2). A point at the focus distance sends a cone of rays through the lens that reconverges exactly on the sensor, a sharp point. A point too far away focuses in front of the sensor, so by the time its cone reaches the sensor it has opened back up into a small disk; a point too near focuses behind the sensor and likewise lands as a disk. That blur disk is the circle of confusion. A point still counts as "sharp" as long as its circle of confusion stays smaller than some acceptable diameter $c$, set by the sensor's resolution and how large you will view the print (for 35 mm film, $c$ is traditionally about 0.02 mm). The disk grows with the aperture (a wider opening, a fatter cone, a bigger disk) and with the point's distance from the focus plane (zero exactly at focus, growing both ways) (Figure 2.9.3).

💡 Big lesson (L2.33) — depth of field is set by a maximum acceptable circle of confusion

A defocused point never images as a point but as a blur disk: the circle of confusion. The depth of field is then defined as the range of distances over which that disk stays smaller than a chosen maximum $c$: inside the depth of field every point is blurred less than $c$, outside it more. The operative word is acceptable: $c$ is not a constant of nature but a judgement call that depends on the target application, the viewing distance, and the sensor (or print) resolution. A billboard read from across the street tolerates a huge $c$; a 100% crop on a 4K monitor almost none. Change the standard and the depth of field changes with it, even though the optics did not.

fig-circle-of-confusion
Figure 2.9.2. The circle of confusion. A point at the focus distance reconverges to a single point on the sensor (sharp). A point too far focuses in front of the sensor and a point too near focuses behind it, so each reaches the sensor as a small disk: the circle of confusion. A point is judged acceptably sharp while its disk stays under a tolerance diameter c.
fig-defocus-vs-parameters
Figure 2.9.3. Defocus (circle of confusion) versus its parameters. Two panels sweep the blur-disk diameter against (left) aperture, where a wider opening (smaller N) gives a fatter cone and a bigger disk, and (right) the object's distance from the focus plane, zero exactly at focus, growing both ways (and faster in front than behind). Focal length and focus distance enter too. The circle of confusion is what the depth-of-field limits cap at the tolerance c.

The formula. All of this is one short calculation. Focus at distance $s$, so the lens (aperture diameter $D = f/N$) images the focus plane sharply onto the sensor. A point at some other distance $d$ would focus at a slightly different image distance, so its cone reaches the sensor still open, as a disk. Following that cone by similar triangles (the image-side construction of Figure 2.9.8) and eliminating the image distances with the thin-lens conjugate relation $1/f = 1/v + 1/d$ gives the circle of confusion as a function of the point's distance:

$$ c(d) = \frac{f^2\,\lvert s-d\rvert}{N\,d\,(s-f)}. $$

Everything qualitative reads straight off it: the blur is exactly zero at $d = s$ (the focus plane), grows with the focal length squared, grows as the aperture opens (small $N$), and grows with how far the point strays from focus. For a subject far compared with the focal length, $s - f \approx s$ and it simplifies to the approximate form

$$ c(d) \approx \frac{f^2\,\lvert s-d\rvert}{N\,d\,s}. $$

The two agree to well under a pixel for ordinary photography and part company only in the macro range, where $s$ approaches $f$ (Big lesson L2.35). One special case is worth keeping: a background at infinity ($d \to \infty$, so $\lvert s-d\rvert / d \to 1$) blurs to $c_\infty \approx f^2/(N s)$, which equals the tolerance $c$ exactly when $s$ is the hyperfocal distance $H = f^2/(N c)$. That coincidence, background-blur-equals-tolerance at $s = H$, is the tie we exploit below.

2.9.2 Depth of field versus depth of focus

The circle of confusion has two faces, and it is worth separating them because they are easy to confuse (the names differ by one word). Depth of field is the object-side story we have been telling: with the sensor fixed, it is the range of subject distances that image acceptably sharply. Depth of focus is its image-side mirror: with the subject fixed, it is the range of sensor positions that keep that subject acceptably sharp, the mechanical tolerance on where the sensor (or film) is allowed to sit behind the lens. One lives out in the world in front of the lens; the other lives in millimeters, or rather microns, behind it.

They are conjugates, tied by the magnification. On the image side the tolerance is simply $2Nc$ (the blur cone reaches the tolerance $c$ when the sensor is displaced by $\pm N c$ either way), essentially independent of subject distance; project that image-side band back out through the lens and you get the object-side depth of field, which is why the latter stretches so dramatically with distance while the former barely moves. The practical weight is all on how small depth of focus is: at $f/2$ with $c \approx 0.02$ mm it is only about $\pm 0.04$ mm, so the sensor must be positioned, held flat, and kept parallel to that tolerance, and an autofocus system must place the focus to it. This is exactly why fast lenses demand tighter mechanical precision, why sensor flatness and film flatness matter, and why back- or front-focus of even a fraction of a millimeter is visible wide open but forgiven when stopped down (larger $N$ widens the depth of focus in proportion). Same geometry, two sides of the lens: depth of field is the photographer's concern, depth of focus the camera engineer's.

2.9.3 Choosing the maximum circle of confusion

The whole depth-of-field machinery hangs on one number, the tolerance $c$, and the big lesson above already warned that it is a judgement, not a constant. It is worth being concrete about how that judgement has actually been made, because there are three different conventions and they answer three different questions.

The classic version. Before digital, $c$ was pinned to a standard viewing scenario: enlarge the negative to a normal print (about 8×10 inches), view it at a comfortable distance (roughly the print's own diagonal, ~25–30 cm), and assume the eye resolves about 5 line-pairs per millimetre there. Trace that back through the enlargement and you get a fixed circle of confusion on the film or sensor, and the rule of thumb that survives is $c \approx \text{(sensor diagonal)}/1500$, about 0.02–0.03 mm for full-frame. Every depth-of-field scale ever engraved on a lens, and every online DoF table, quietly bakes in this one scenario. Its virtue is a single number per format; its vice is that it is wrong the moment you view the image any other way.

Pixel size. A digital-native alternative ignores viewing entirely and sets $c$ to a small multiple of the pixel pitch, often just one or two pixels. This is the right tolerance when the file itself is the product, judged at 100% on a monitor, or fed to a matching or reconstruction algorithm: a blur smaller than a pixel cannot be recorded anyway, so anything under a pixel is automatically "sharp." It ties depth of field to the sensor's resolution rather than to any print.

Different display conditions. Both of the above are special cases of the only definition that is really true: $c$ is set by whatever blur is just too small to see in the final image, as it is actually viewed. A billboard read from across the street, a phone at arm's length, and a 100% crop on a 4K monitor differ by orders of magnitude in the tolerance they allow, from the same negative. The clean way to compute it is to work in the viewing geometry directly. The eye resolves about one arcminute; a blur on the display that subtends less than that is invisible. So from the display size, the viewing distance, and the image's pixel count you can read off the largest circle of confusion that still looks sharp, in image pixels or as a fraction of the frame, with the classic $\text{diagonal}/1500$ falling out as the one frozen standard (Figure 2.9.4). Set $c$ from your output, not from a table built for someone else's print.

fig-max-coc-calculator
Figure 2.9.4. The acceptable circle of confusion, from the viewing conditions, interactive. Depth of field is set by a tolerance $c$, the largest blur still judged sharp, and $c$ is a property of how the picture is viewed, not of the lens. The eye resolves about 1 arcminute; a blur on the display smaller than that is invisible. Set the display size, image resolution, and viewing distance, and the calculator returns the largest circle of confusion that still looks sharp, in image pixels and as a percent of the frame, floored at one pixel (the image carries no finer detail). A billboard tolerates a huge $c$; a 100% crop on a monitor almost none. The classic $\text{diagonal}/1500$ still-camera number is shown as a cross-check: it is exactly this calculation frozen at one standard, a normal print viewed at its own diagonal.

2.9.4 The double cone, and the near and far limits

The simplest picture lives in object space: a double cone in front of the lens, its waist sitting on the focus plane, whose width at any depth is the blur that a point there would produce (Figure 2.9.6). Depth of field is the range of object distances whose circle of confusion stays within $c$, bounded by a near limit (closest still-sharp distance) and a far limit (farthest). The derivation is the same similar-triangles move as above, now solved the other way: take the circle-of-confusion formula, set $c(d) = c$, and solve for the object distance $d$. Because $c(d)$ carries $d$ in its denominator, that is a quadratic, and its two roots are the near and far limits (Figures 9, 10, and 11). Written with the hyperfocal distance $H = f^2/(N c) + f$ they take their standard compact form

$$ D_n = \frac{s\,(H-f)}{H + s - 2f}, \qquad D_f = \frac{s\,(H-f)}{H - s}, $$

with $D_f = \infty$ as soon as $s \ge H$: the far limit has run off to infinity, which is exactly what singles $H$ out. The total depth of field is $D_f - D_n$. Dropping the small $-f$ and $-2f$ terms (the same $s \gg f$ assumption) tidies these to

$$ D_n \approx \frac{sH}{H+s}, \qquad D_f \approx \frac{sH}{H-s}, \qquad \text{DoF} \approx \frac{2 H s^2}{H^2 - s^2}, $$

and one further step, for a subject much closer than the hyperfocal distance ($s \ll H$), collapses the total to the memorable scaling of the next lesson, $\text{DoF} \approx 2 N c\,s^2/f^2$. That last form is the one to carry around, and also the most approximate: it assumes both $s \gg f$ and $s \ll H$, so it is faithful across the everyday portrait-to-landscape middle and wrong at both ends, collapsing too fast in macro and, more visibly, missing the runaway to infinity as $s$ approaches $H$. The exact limits and their approximations are plotted together in Figure 2.9.10: the curves lie on top of each other across the ordinary range and split apart precisely where the assumptions fail. One caveat the tidy formulas hide is that the depth of field is asymmetric, with more sharp depth behind the focus plane than in front (the "roughly one third in front, two thirds behind" rule of thumb), and that asymmetry only grows with distance until the far limit reaches infinity. The qualitative results, though, are what you carry around, and they all point the same way: depth of field grows with a smaller aperture (larger $N$), a shorter focal length, and a greater focus distance (Figure 2.9.9). Stopping down is the photographer's main knob, but it costs light, so it forces a longer exposure or a higher ISO (more noise), and stopped down too far, diffraction softens everything (previous part). You can only push it so far.

Before calculators, all of this was engraved on the lens itself (Figure 2.9.5). The depth-of-field scale on a manual-focus barrel is a mechanical solution of exactly these near- and far-limit equations: two mirrored rows of f-numbers straddle the focus index, and for a chosen aperture its two marks bracket the near and far distances that will be sharp. Wider apertures give a narrow pair of marks (shallow depth), smaller apertures a wide pair, and setting the far mark on the infinity symbol is how you dial in the hyperfocal distance of the next section by hand.

fig-dof-scale-lens
Figure 2.9.5. The depth-of-field scale on a lens barrel. Around the focus-distance index sit two mirrored rows of f-numbers. Set the focus distance, then for any f-number read the near and far limits of sharpness straight off — the distances lying between its two marks are in focus. It is the near/far double-cone limits made into a mechanical calculator: wider apertures give a narrow pair of marks, smaller apertures a wide one, and aligning the far mark on infinity sets the hyperfocal distance. (Nikon 28 mm f/2.8.)
💡 Big lesson (L2.34) — depth of field scales linearly with f-number, quadratically with distance, inverse-quadratically with focal length

Away from the macro range (subject much closer than the hyperfocal distance), the total depth of field follows a clean scaling, $\text{DoF}\approx \dfrac{2\,N\,c\,s^2}{f^2}$: it grows linearly with the f-number $N$ (stop down for more), quadratically with the focusing distance $s$ (step back and it balloons), and inversely with the square of the focal length $f$ (wider for more, longer for less). These three exponents explain at a glance why a phone (tiny $f$) keeps almost everything sharp, why close focus annihilates depth of field, and why "I need more in focus" always reduces to stop down, back up, or go wider.

💡 Big lesson (L2.35) — many approximations break in the macro regime

The convenient first-order results of this chapter (the depth-of-field scaling just above, the framing shortcut "magnification $\approx f/\text{distance}$", even the bare f-number as a stand-in for image brightness) all quietly assume the subject is far compared with the focal length. Up close (macro, at magnifications near or past 1:1) they break. The pupil magnification stops being 1, the effective f-number grows as $N(1+m)$ so you lose real light, the working distance shrinks toward the front element, and the depth of field collapses to millimeters. In the macro regime you must drop the shortcuts and return to the exact conjugate geometry (and, often, to focus stacking). It is a good reflex to ask of any optics approximation: does this still hold when the subject is this close?

fig-dof-double-cone
Figure 2.9.6. Defocus as a double cone (object space). In front of the lens, the in-focus plane is the waist of a double cone whose width at any depth is the blur that a point there would produce. It gives the circle of confusion for one scene point; the cone widens with aperture. The depth of field is the band around the waist where the cone stays narrower than the tolerance c.
fig-depth-of-field
Figure 2.9.7. The near and far limits of depth of field. Each scene point's cone is carried to the sensor; the near-limit object focuses behind the sensor and the far-limit object in front of it, each producing a circle of confusion just equal to the tolerance c. The band between them is the depth of field, slightly asymmetric, with more depth behind the focus plane than in front. (Vertical scale exaggerated.)
fig-dof-derivation-near
Figure 2.9.8. The near (front) limit by similar triangles. Image-side construction: a near-limit object images behind the sensor; the converging cone from the aperture D crosses the sensor in a disk of diameter c. The similar triangles relating D, the image-side geometry, and c (with 1/f = 1/u + 1/v) fix the nearest acceptably-sharp object distance.
fig-dof-vs-parameters
Figure 2.9.9. Depth of field versus its three controls. Three panels plot the paraxial near/far limits against aperture (larger N → more DoF), focal length (shorter → more DoF), and focus distance (farther → more DoF). The same panels show the hyperfocal distance H = f²/(N·c) emerging as the focus setting beyond which the far limit runs to infinity.
fig-dof-approx-vs-exact
Figure 2.9.10. Exact formulas versus their approximations, interactive. Set the focal length, f-number, acceptable circle of confusion, and sensor size, then read the two panels. Left: the circle of confusion $c(d)$ against object distance, the exact $f^2|s-d|/(N d(s-f))$ drawn against the far-subject approximation that drops the $-f$; the two overlie each other for a normal subject and separate only as the focus distance is pushed into the macro range. Right: the total depth of field against focus distance $s$, the exact $D_f - D_n$ against the memorable $2Ncs^2/f^2$ scaling; they track across the everyday range and split apart as $s$ nears the hyperfocal distance $H$ (marked), where the exact depth of field runs to infinity while the approximation keeps climbing as a mere parabola. A quantitative companion to the "know when your approximation breaks" lesson.
fig-dof-parameter-grid
Figure 2.9.11. Depth of field versus all its parameters, interactive. The same scene shot across the aperture ($f/2$, $f/4$, $f/8$, $f/16$) and two geometric factors, the focal length (50 mm → 100 mm) and the subject distance (≈0.5 m → ≈1 m). A button pivots which factor runs along the columns versus the rows, and clicking any frame enlarges it below. Wider aperture, longer lens, and closer subject all shrink the depth of field (and throw the background further out of focus); a narrower aperture, wider lens, or more distance deepens it. Parameters from EXIF (distances approximate). Photographs by Frédo Durand.

2.9.5 Hyperfocal distance

There is one focus setting that wrings the maximum depth of field out of a lens. Focus at the hyperfocal distance

$$ H = \frac{f^2}{N\,c}, $$

and everything from $H/2$ all the way to infinity falls within the tolerance $c$ (Figure 2.9.12). This is the landscape photographer's trick (Ansel Adams used it constantly): focusing at infinity instead wastes the whole sharp zone between $H/2$ and $H$, whereas focusing at $H$ buys it back for free.

This is also the principle behind fixed-focus cameras, which have no focusing mechanism at all: the lens is simply glued at (or just beyond) the hyperfocal distance so that everything from $H/2$ to infinity is acceptably sharp. Because $H = f^2/(Nc)$ shrinks with the square of the focal length, this is easy when $f$ is tiny, which is exactly why it works so well for the short focal lengths of disposable cameras, webcams, doorbell and security cameras, and the ultra-wide modules on phones, and why those wide phone cameras can skip autofocus entirely while their longer (tele) modules cannot. The cost is that you can never throw the background out of focus or focus closer than $H/2$; fixed focus trades away near-subject sharpness and selective focus for a camera with no moving parts.

💡 Big lesson (L2.36) — focus at the hyperfocal distance and everything from half it to infinity is sharp

There is a single focus setting that extracts the maximum depth of field from a lens: the hyperfocal distance $H = f^2/(N c)$. Focus there and the far limit runs all the way to infinity while the near limit sits at exactly $H/2$, so the entire scene from $H/2$ to the horizon falls inside the acceptable circle of confusion. Focusing at infinity instead throws away the whole sharp zone between $H/2$ and $H$ for nothing. It is the landscape-and-street photographer's standard move for front-to-back sharpness, and the basis of zone focusing (pre-set the focus, shoot without refocusing).

fig-hyperfocal
Figure 2.9.12. Hyperfocal distance. Focusing at H = f²/(N·c) makes everything from H/2 to infinity acceptably sharp, the focus setting that maximizes depth of field. Focusing at infinity instead (top) leaves the near zone H/2…H blurred and wastes it; focusing at H (bottom) reclaims it. The landscape photographer's standard move for front-to-back sharpness.

2.9.6 The surprising invariance

The practical conclusion is that a longer focal length does not, by itself, reduce depth of field when framing and f-number are held fixed. "Telephoto lenses have shallow depth of field" is not really true as stated. For a fixed framing (you keep the subject the same size in the frame) and a fixed f-number, the depth of field in object space is essentially independent of focal length (Figure 2.9.13). Switch from a 28 mm to a 100 mm lens and, to keep the subject the same size, you must step back; stepping back deepens the depth of field by exactly as much as the longer focal length shrinks it, and the larger physical aperture of the long lens (same f-number $N = f/D$ means $D$ grew with $f$) cancels the rest. The two effects exactly compensate. So shallow depth of field is really about magnification (how large the subject is on the sensor), not focal length per se.

This is genuinely useful: for macro work, where depth of field is precious, you can change your working distance (back off to make room for lights, say) without changing the depth of field at all, as long as you re-frame to the same magnification. The background does still look more blurred through the long lens, but that is because the long lens magnifies the already-out-of-focus background disks, not because the depth-of-field band changed.

fig-dof-same-framing
Figure 2.9.13. Same framing + same f-number → same depth of field. A subject is shot at 28 mm up close and at 100 mm from farther back, framed to the same size and at the same f-number. The band of acceptably sharp depth around the subject is the same in both: the longer focal length is exactly canceled by the greater distance (and the larger physical aperture). Shallow depth of field comes from magnification, not focal length. (The distant background is more blurred in the telephoto shot because it is magnified more, a separate effect.)
fig-focus-magnification
Figure 2.9.14. Refocusing changes the projected size ("focus breathing"). The same 90 mm lens on the same scene, changed only by turning the focus ring: left, focused on the near figures; right, on the far ones. Notice that the projection of the subject is a different size even though the focal length hasn't changed: refocusing moves the image plane, so the magnification (and the field of view) drifts. It is why focus stacking and focus pulls need care. And this drift persists despite the lens maker fighting it: a compound lens can be built to shift its own effective focal length slightly as it focuses (internal-focusing trickery a single element could not manage), which curbs the breathing but does not erase it. The diagram below traces the geometry. Photographs by Frédo Durand.
fig-focus-fov
Figure 2.9.15. The geometry of focus breathing. A thin lens of fixed focal length $f$ images a row of colored disks (the Lego figures) onto a sensor; to focus on a disk at distance $o$ the sensor slides to that disk's image distance $i = f\,o/(o-f)$ — focusing moves the sensor, not the lens. The shaded double cone is the field of view, the rays from the two sensor edges through the centre of the lens continued into the scene. Drag the focus (or click a disk) and watch the sensor slide: the cone opens or closes and the projection of every disk grows or shrinks, even though the focal length never changes. Thin-lens model.

All of this (the three controls, the circle of confusion, the near/far limits, the hyperfocal distance, and the constant-magnification invariance) is easiest to feel by driving it yourself (Figure 2.9.16). It is the same physics as the 3-D macro simulator at the end of this chapter, drawn as a single 2-D ray diagram plus a plot, so the numbers are right there: slide the focal length, f-number, and subject distance and watch the near/far limits and $H$ move; then tick constant magnification and watch the depth of field go nearly flat against focal length, the invariance of the previous paragraph, made literal.

fig-dof-raydiagram
Figure 2.9.16. Depth of field as a 2-D thin-lens ray diagram, interactive. Set focal length, f-number, subject distance, the acceptable circle of confusion c, and the sensor size. The diagram shows the focused cone converging to a point on the sensor while a background point reconverges in front of it and spreads into a blur disk; the plot below shows the blur-disk diameter versus object distance, with the c tolerance and the shaded near–far depth-of-field window, and the focus and hyperfocal distances marked. The readout gives H, the near/far limits, the total DoF, and the magnification. Tick "constant magnification" to instead plot total DoF against focal length at fixed framing: a nearly flat line, the depth-of-field-is-about-magnification lesson made quantitative. A lighter companion to the 3-D depth-of-field simulator.

The invariance is sharpest when you plot two focal lengths at once (Figure 2.9.17). Fix the magnification (the same framing of the subject) and draw the circle of confusion against distance from the focus plane for a short and a long lens: around the focus the two curves coincide, so the depth of field is the same, but far behind the subject the long lens climbs to a much higher plateau. That plateau is the background blur, and it equals the aperture diameter times the magnification ($f\,m/N$), so it grows with focal length. Depth of field is set by magnification; how hard a distant background is thrown out of focus is set by the aperture diameter. The two facts live in the same picture.

fig-coc-same-magnification
Figure 2.9.17. Two focal lengths at the same magnification, interactive. Pick two focal lengths and hold the magnification fixed (or set the subject distance for the first lens and let the second match its framing); the circle of confusion is plotted against distance from the focus plane for both. Near the focus the curves overlap, the depth of field is essentially identical, the invariance made literal, while far behind the subject the longer lens plateaus much higher: its background blur is $f\,m/N$ (aperture diameter times magnification), so it scales with focal length. The lesson in one figure: depth of field follows magnification, background blur follows the aperture diameter.

2.9.7 Background blur beyond the focus plane

The invariance is a statement about the near neighborhood of the focus plane: hold the framing and two focal lengths give the same depth of field. Push past that neighborhood, out toward the background, and the two lenses part company. The circle of confusion keeps growing with distance from the focus plane, and it grows faster for the longer lens, until it saturates at a ceiling set by a subject infinitely far away. That ceiling is the background blur, the quantity that decides how cleanly a portrait separates from its backdrop, and it is worth deriving on its own.

The infinity blur. Take the circle of confusion of the previous sections and let the object recede to infinity. With the subject focused at $s$,

$$ c(d) = \frac{f^2\,\lvert d-s\rvert}{N\,d\,(s-f)} \;\xrightarrow{\,d\to\infty\,}\; c_\infty = \frac{f^2}{N\,(s-f)}, $$

because $\lvert d-s\rvert / d \to 1$. This is the on-sensor blur diameter of a point infinitely far behind the subject. It has a clean reading once you substitute the aperture diameter $D=f/N$ and the on-axis magnification $m=f/(s-f)$:

$$ c_\infty = \frac{f^2}{N\,(s-f)} = \frac{f}{N}\cdot\frac{f}{s-f} = D\,m, $$

the aperture diameter times the magnification, the same $f\,m/N$ plateau the two-focal-length figure climbed to. Read it two ways. At a fixed framing (fixed $m$) it scales with the physical aperture $D$, which is the sensor-size argument of the next section: a bigger lens throws a background further out of focus. At a fixed subject distance $s$, which is what a photographer swapping lenses on the spot actually holds, it scales as $f^2/(s-f)$, close to $f^2$ for an ordinary subject, so doubling the focal length roughly quadruples the background blur. That is the real content of "telephotos blur the background": it is a claim about the background, not about the depth of field, which the previous section showed is unchanged at fixed framing. A big super-telephoto, with its large physical aperture, is where this reaches its extreme (Figure 2.9.18): a distant background collapses into a smooth wash, isolating the subject completely.

fig-lava-heron-bokeh
Figure 2.9.18. Subject separation from a large aperture. A lava heron photographed at 700 mm (a 500 mm super-telephoto with a 1.4× teleconverter) at $f/7.1$ on a Canon EOS-1D Mark II: the bird is sharp, but the distant background dissolves into a smooth wash of green and out-of-focus highlights. This is the infinity-blur plateau $c_\infty = D\,m$ made visible — even at $f/7.1$ the physical aperture is $D = f/N = 700/7.1 \approx 100$ mm across, so a far point is smeared over a big fraction of the frame and the subject stands cleanly clear of its surroundings. The separation is set by the aperture diameter (and the magnification), not by the depth of field, which stays shallow right at the bird.

To compare $c_\infty$ against a tolerance, divide by the sensor width $w$ for a fraction of the frame, or multiply by the horizontal pixel count $n_\text{px}$ for pixels:

$$ \frac{c_\infty}{w} = \frac{f^2}{N\,(s-f)\,w}, \qquad c_\infty^{\,\text{px}} = \frac{f^2\,n_\text{px}}{N\,(s-f)\,w}. $$

The background blur is thus fixed by five numbers: the f-number, the focal length, the focus distance, the sensor size, and (for pixels) the resolution. Figure 2.9.19 plots it against focal length at a chosen f-number and distance, and the near-$f^2$ climb is the whole story.

fig-background-blur-vs-focal-length
Figure 2.9.19. Background blur versus focal length, interactive. A point at infinity blurs on the sensor to $c_\infty = f^2/(N(s-f))$, equivalently the aperture diameter times the magnification ($D\,m$). Fix the f-number and the subject distance and sweep the focal length: at fixed distance the blur climbs roughly as $f^2$, so a long lens throws a distant background far out of focus while a wide lens keeps it legible, even though (previous section) the near-focus depth of field is the same at equal framing. Choose the axis units (microns, percent of the frame, or pixels for a given resolution and sensor); a marker reads the blur at one focal length, with the aperture diameter and magnification alongside.
[figure fig-background-blur-focal-length-photos not built]
Figure 2.9.20. Background blur grows with focal length, at fixed framing. The same subject shot at a wide, a normal, and a telephoto focal length, each time stepping back to keep the subject the same size in the frame. The subject is equally sharp in all three (the depth of field is the same, the invariance of the previous section), but the background dissolves progressively: the long lens, with its larger physical aperture, smears a distant point across a far larger fraction of the frame. This is subject separation, and it is set by the aperture diameter, not by the depth of field. Photographs by Frédo Durand.

The whole field. The infinity blur is one edge of a two-dimensional picture. Hold the f-number and the focus distance and the full circle of confusion is a function of two variables at once, the focal length and the signed distance from the focus plane $\Delta = d - s$ (background positive, foreground negative):

$$ c(f,\Delta) = \frac{f^2\,\lvert\Delta\rvert}{N\,(s+\Delta)\,(s-f)}. $$

Figure 2.9.21 draws this field, as a colour map or a spinnable 3-D surface. Two features carry the depth-of-field story in one image. Along $\Delta=0$ runs a valley of zero blur, the focus plane. Its slope, the rate at which blur opens up as you leave focus, is $\lvert\partial c/\partial\Delta\rvert$ at $\Delta=0$, which reduces to

$$ \left.\frac{\partial c}{\partial \Delta}\right|_{\Delta \to 0^+} = \frac{f^2}{N\,s\,(s-f)} = \frac{m^2}{N\,(m+1)}, $$

depending only on the magnification and the f-number, not on the focal length. That is the invariance, made into a tangent: at a given framing every focal length shares the same ridge slope at the valley, so the same near-focus depth of field. Away from focus the surface climbs, and it climbs steeper for larger $f$, so the curves for two focal lengths, tangent at the valley, separate as $\Delta$ grows and level off at the infinity ceiling $c_\infty = f^2/(N(s-f))$ derived above. Depth of field lives in the tangent; background blur lives in the plateau; the one surface holds both.

fig-coc-field-f-defocus
Figure 2.9.21. The circle of confusion as a field over focal length and defocus, interactive. One picture of the full formula $c(f,\Delta) = f^2\lvert\Delta\rvert / (N(s+\Delta)(s-f))$, with $\Delta$ the signed distance from the focus plane, at a chosen focus distance and f-number. Switch between a 2-D colour map and a 3-D height field you can spin (azimuth). The valley along $\Delta=0$ is the focus plane, whose tangent (the near-focus slope $m^2/(N(m+1))$) is shared by every focal length at a fixed framing: the depth-of-field invariance. Climb the focal-length axis and the walls steepen, so a distant background blurs far more through a long lens, levelling off at the infinity ceiling $f^2/(N(s-f))$. The sensor sets the percent/pixel units on the colour scale.

The calculator. All of this (the exact circle of confusion and its far-subject approximation, the near and far limits, the hyperfocal distance, the infinity blur, and the tolerance that turns a blur into a depth of field) gathers into one working tool in Figure 2.9.22. Set the focal length (as a 35 mm-equivalent, so the framing is held fixed as you change sensors), the f-number, the focus distance, the sensor, and your acceptable circle of confusion in pixels or percent of the frame. It draws the circle of confusion against distance, marks the infinity blur and the tolerances a single pixel, a phone, and the eye's acuity each imply, and reads the depth of field off at your setting and at typical phone and 16-inch-laptop viewing, giving both the exact thin-lens value and the $2Ncs^2/f^2$ approximation side by side. The tangent near focus is where the depth-of-field invariance lives; the growth beyond it, out to the infinity plateau, is the background blur. It is the calculator form of the one idea this chapter keeps returning to: the depth of field is only as real as the maximum circle of confusion you are willing to accept, and that number comes from how the picture will be seen.

fig-dof-calculator
Figure 2.9.22. A full depth-of-field calculator, interactive. Inputs: focal length (with a 35 mm-equivalent toggle, on by default, so framing is fixed across sensors), f-number, focus distance, sensor size, and the maximum circle of confusion in pixels or percent of image width. It plots the circle of confusion versus object distance as both the exact thin-lens curve and its far-subject approximation, with a zoom inset on the depth-of-field region, draws the circle-of-confusion-at-infinity asymptote and horizontal tolerance lines for one pixel, typical phone viewing, and human acuity, and tabulates the depth of field, at your tolerance and at phone and 16-inch-laptop viewing conditions, computed both exactly and by the $2Ncs^2/f^2$ approximation. Pixels assume a 24 MP frame.

2.9.8 Defocus is not a blur of the image

It is tempting to think you could fake shallow depth of field by simply blurring a sharp photo, convolving it with a disk. You cannot, and the reason matters (Figure 2.9.23). The circle of confusion depends on each point's scene depth, not on its position in the image, so the blur is spatially varying in a way tied to 3D structure rather than pixel coordinates. Worse, at depth discontinuities (the edge of a foreground object against a far background) occlusion comes into play: the blurred foreground should bleed over the background, and the background that the foreground hides should partly show through the foreground's blur, neither of which a flat 2D blur can do. Depth of field is not a convolution of the image. This is exactly why naive "portrait mode" fakes look wrong at hair and edges, and why depth-aware and light-field methods (Advanced part), which know each pixel's depth, or capture the rays directly, do so much better.

fig-dof-depth-dependent
Figure 2.9.23. Why defocus is not an image convolution. Left, a spatially-invariant disk blur of a flat image: every pixel blurred the same, ignoring depth. Right, true defocus: the blur radius is set by each point's scene depth, and at the foreground–background boundary occlusion matters: the foreground's blur bleeds over the background and the background shows through. A 2D convolution cannot reproduce either, which is why depth-unaware fakes fail at edges.

2.9.9 Sensor size scales depth of field

Finally, a fact that explains your phone. Shrink the sensor while keeping the field of view (FOV), and both the circle of confusion $c$ and the physical aperture $D$ shrink in proportion, so depth of field grows linearly as the sensor shrinks. Phone cameras therefore have enormous depth of field: almost everything is in focus, which is why they must fake background blur computationally (portrait mode). The same fact makes macro photography easier on small sensors: a scaled-down camera photographs a scaled-down world, gaining both closer minimum focus and more depth of field for free, except for diffraction, since shrinking the camera does not shrink the wavelength of light.

The same story told from the image side is the one a phone designer feels most acutely. For a subject held at a fixed framing, the out-of-focus blur of the background (measured as a fraction of the frame) is proportional to the lens's physical aperture diameter $D = f/N$. Scale the whole camera down by the crop factor (sensor and focal length shrink together, the f-number $N$ held fixed) and $D$ shrinks by that same factor, so the background blur shrinks linearly with the sensor. A phone, whose sensor is roughly seven times smaller than full frame, therefore produces about seven times less background blur at the same f-number, which is exactly why it cannot throw a background out of focus and must synthesize shallow depth of field in software (portrait mode; the computational treatment is a later chapter). Put as equivalence: a phone at $f/1.8$ has the depth of field of a full-frame lens at roughly $f/12$.

💡 Big lesson (L2.37) — in image space, defocus blur shrinks linearly with the sensor

Hold the framing and the f-number fixed and scale the camera down: the defocus blur of the background, as a fraction of the frame, shrinks linearly with the sensor size, because it tracks the lens's physical aperture diameter $D=f/N$ and $f$ shrinks with the sensor. So shallow depth of field is a privilege of physically large apertures (a big sensor with a big lens) and a small sensor cannot fake it optically. This is why phones have deep depth of field and must compute fake background blur (portrait mode, a later chapter): the tiny sensor shrinks every blur disk toward nothing. It is the image-space twin of "small sensor → more depth of field" above.

A revealing optical workaround predates the computational one: relay optics. Place a physically large lens out front to cast a large, genuinely shallow-depth-of-field image onto a diffusing ground-glass screen, then re-photograph that screen with a small-sensor camera through a macro/relay lens. The small camera now inherits the big lens's shallow depth of field (and its wide field of view), paying only in lost light, a little softness, and the screen's faint grain. This is precisely how 35 mm lens adapters (the Letus, Redrock M2, and Brevis units, and the older Frazier-style relays) let early small-sensor camcorders (and the first video-DSLR rigs) borrow a large-format "cinematic" look before big-sensor video existed; the same relay trick lives on in view-camera ground glass and in microscope-to-camera couplings.

fig-depth-of-field-sim
Figure 2.9.24. Try it yourself (web edition). A live macro depth-of-field simulator with three linked panels driven by one optics model: a to-scale thin-lens diagram, a lens-supersampled 3D photo with real bokeh, and a circle-of-confusion-versus-distance plot. Set the focal length, f-number, sensor size, focus distance, and subject–background gap, and choose a bug (beetle, bee, or ladybug) over a flower. The macro lesson is immediate: the in-focus slice is so thin that focus on the front of the face leaves the rest of the body, the antennae, and the background all dissolved. In the printed edition this figure stands in as a screenshot. The bug and flower are 3D models generated with Meshy AI.

Recap: big lessons of this chapter

(L2.33) — depth of field is set by a maximum acceptable circle of confusion

A defocused point never images as a point but as a blur disk: the circle of confusion. The depth of field is then defined as the range of distances over which that disk stays smaller than a chosen maximum $c$: inside the depth of field every point is blurred less than $c$, outside it more. The operative word is acceptable: $c$ is not a constant of nature but a judgement call that depends on the target application, the viewing distance, and the sensor (or print) resolution. A billboard read from across the street tolerates a huge $c$; a 100% crop on a 4K monitor almost none. Change the standard and the depth of field changes with it, even though the optics did not.

(L2.34) — depth of field scales linearly with f-number, quadratically with distance, inverse-quadratically with focal length

Away from the macro range (subject much closer than the hyperfocal distance), the total depth of field follows a clean scaling, $\text{DoF}\approx \dfrac{2\,N\,c\,s^2}{f^2}$: it grows linearly with the f-number $N$ (stop down for more), quadratically with the focusing distance $s$ (step back and it balloons), and inversely with the square of the focal length $f$ (wider for more, longer for less). These three exponents explain at a glance why a phone (tiny $f$) keeps almost everything sharp, why close focus annihilates depth of field, and why "I need more in focus" always reduces to stop down, back up, or go wider.

(L2.35) — many approximations break in the macro regime

The convenient first-order results of this chapter (the depth-of-field scaling just above, the framing shortcut "magnification $\approx f/\text{distance}$", even the bare f-number as a stand-in for image brightness) all quietly assume the subject is far compared with the focal length. Up close (macro, at magnifications near or past 1:1) they break. The pupil magnification stops being 1, the effective f-number grows as $N(1+m)$ so you lose real light, the working distance shrinks toward the front element, and the depth of field collapses to millimeters. In the macro regime you must drop the shortcuts and return to the exact conjugate geometry (and, often, to focus stacking). It is a good reflex to ask of any optics approximation: does this still hold when the subject is this close?

(L2.36) — focus at the hyperfocal distance and everything from half it to infinity is sharp

There is a single focus setting that extracts the maximum depth of field from a lens: the hyperfocal distance $H = f^2/(N c)$. Focus there and the far limit runs all the way to infinity while the near limit sits at exactly $H/2$, so the entire scene from $H/2$ to the horizon falls inside the acceptable circle of confusion. Focusing at infinity instead throws away the whole sharp zone between $H/2$ and $H$ for nothing. It is the landscape-and-street photographer's standard move for front-to-back sharpness, and the basis of zone focusing (pre-set the focus, shoot without refocusing).

(L2.37) — in image space, defocus blur shrinks linearly with the sensor

Hold the framing and the f-number fixed and scale the camera down: the defocus blur of the background, as a fraction of the frame, shrinks linearly with the sensor size, because it tracks the lens's physical aperture diameter $D=f/N$ and $f$ shrinks with the sensor. So shallow depth of field is a privilege of physically large apertures (a big sensor with a big lens) and a small sensor cannot fake it optically. This is why phones have deep depth of field and must compute fake background blur (portrait mode, a later chapter): the tiny sensor shrinks every blur disk toward nothing. It is the image-space twin of "small sensor → more depth of field" above.