Depth of field and resolution in close-up, macro photography and photomacrography  

Note: I wrote this page a few years ago and did not update its contents since. While the discussion of DoF on this page is correct, the calculations and the given DoF formula can be simplified and slightly corrected. There is a more updated, extensive and reliable coverage of DoF in my book "Digital photography for science". The Excel spreadsheed accompanying this book contains a set of DoF dynamic tables and is freely downloadable from the above link. I also have a fully configurable, very flexible DoF applet available on this site, which can be used to generate very comprehensive, customized tables.

Depth of field (DOF) is of special concern in close-up, macro photography and photomacrography. As discussed here, all else being the same, DOF decreases as magnification increases. As a consequence, pictures taken at high magnification suffer from a shallow DOF. This tell-tale DOF allows a viewer, for instance, to immediately tell the difference between a landscape and a close-up of a landscape model. In macro and photomacrography, DOF may be so shallow that only a small part of the subject is in focus.

A common recommendation in macro photography is to stop down the diaphragm in order to achieve the maximum DOF. This is essentially correct, but by blindly following this advice you may also achieve a visibly lower resolution in your pictures.

Circle of confusion

The circle of confusion is the size of the largest unsharp blob that can be perceived as sharp when looking at a photograph. Its definition is somewhat subjective, but in the case of digital photography with a 16 by 24 mm sensor it is usually 20 μm in diameter (on the sensor, not on a printed picture). Considering that pixels on a Nikon D200 sensor have a pitch (= distance between centers of adjacent photo sites along orthogonal directions) of approximately 6.2 μm, the circle of confusion for this camera is roughly 3 pixels across. On a digital sensor, 3 pixels are also the minimum distance at which two points can be rendered as separate.

In addition, the actual resolution of a digital sensor is reduced by its anti-aliasing mask, which spreads light from a point-source to an area with a diameter of 2-3 pixels or more. Therefore, it is reasonable to say that an area with a diameter of 3 pixels represents the practical resolution limit for this camera. Other modern cameras and sensors do differ, but not by very much (keep in mind that doubling the number of photo sites of a sensor only increases its theoretical linear resolution by roughly 1.3 times, so things are not going to change much until we get to 30 megapixels or more, which could be outside the useful range of resolution for general-purpose cameras).

The DOF zone is delimited by the distances at which out-of-focus points are rendered as blobs the size of the circle of confusion. Where the blobs become larger, the picture is perceived as out of focus and blurry. Of course, this is based on the perception of circles of confusion of gradually increasing diameters, so there is no clear borderline between in-focus and out-of-focus distances, and some subjective judgement is involved as well.

Note that most macro lenses display the nominal aperture (i.e., lens diameter / focal length), but a few display instead the effective aperture (i.e., the nominal aperture multiplied by the exposure factor, which is 2 stops at a magnification of 1x).

Effective aperture in macro photography is computed as

where E is the effective aperture, N the nominal aperture and M the magnification. DOF in macro photography is computed as

where f is the focal length and c the circle of confusion.

Based on the above, the following DOF table can be calculated. DOF is expressed as the total depth of field, i.e., the sum of the depth of field in front of and behind the plane of focus. Table 1 displays the nominal aperture in the top row of headers, and the corresponding effective aperture in the following rows. For now, let's ignore the areas framed in pink and red in the table (they are explained below).

DOF at
nom. f/4
effective ap.
at nom. f/4
(f/ ratio)
DOF at
nom. f/5.6
effective ap.
at nom. f/5.6
(f/ ratio)
DOF at
nom. f/8
effective ap.
at nom. f/8
(f/ ratio)
DOF at
nom. f/11
effective ap.
at nom. f/11
(f/ ratio)
DOF at
nom. f/16
effective ap.
at nom. f/16
(f/ ratio)
DOF at
nom. f/22
effective ap.
at nom. f/22
(f/ ratio)
0.1 17 4.4 25 6 35 8.8 49 12 71 18 98 24
0.2 4.8 5.8 6.5 6.5 9.6 9.6 13 13 19 19 27 26
0.3 2.3 5.0 3.2 7 4.6 10 6.4 14 9.3 21 13 28
0.4 1.4 5.5 1.9 7.5 2.8 11 3.9 15 5.6 22 7.7 30
0.5 .95 6.0 1.3 8.5 1.9 12 2.6 17 3.8 24 5.3 34
0.75 .50 6.5 0.8 9.5 1 13 1.4 19 2.0 26 2.7 38
1 .32 8.0 .44 11 .64 16 .88 22 1.3 32 1.8 44
1.5 .18 10 .25 14 .36 20 .49 28 .71 40 .98 56
2 .12 12 .16 16 .24 24 .33 33 .48 48 .66 66
2.5 .09 14 .13 19 .18 28 .25 39 .36 56 .49 78
3 .07 16 .10 22 .14 32 .20 44 .29 64 .39 88
4 .05 20 .07 25 .10 40 .14 55 .20 80 .28 110
5 .039 24 .55 33 .077 48 .11 66 .15 96 .21 132
6 .032 28 .043 38 .062 56 .086 77 .13 112 .17 154
8 .029 32 .031 50 .045 64 .062 99 .090 128 .12 198
10 .018 40 .024 60 .035 80 .048 121 .070 160 .10 242
12 .015 48 .020 71 .029 96 .040 143 .058 192 .079 286
15 .012 60 .015 86 .023 120 .031 176 .046 240 .063 352
20 .009 80 .011 115 .017 160 .023 231 .034 320 .046 462

Table 1. DOF and effective aperture at different magnifications and nominal apertures (computed for focal length = 50 mm).

So far, all is well, and by extending the above table ad infinitum it would appear that any DOF can be achieved, as long as we agree to pay its price in terms of longer exposure. After all, we do know that we can close the aperture of a lens by one stop and expose for twice the time, and still get the same result (except, of course, for a higher DOF). This is known as reciprocity rule.

Incidentally, Table 1 is computed for a lens of 50 mm focal length. While the focal length does have have an effect on DOF at very low magnifications, its effect steadily decreases as magnification increases, and DOF becomes the same, regardless of focal length, at 1x. Table 2 shows the DOF at f/16 and a magnification of 0.1x for lenses of different focal lengths. At this magnification, still far from the macro range, the differences in DOF are already minimal, and can safely be ignored for most purposes.

25 71.57
50 70.69
100 70.47
200 70.42

Table 2. DOF as a function of focal length (computed at nominal f/16 and 0.1x).

Unfortunately, the devil is in the details, and DOF is no exception. Most photographers who have used film still remember a phenomenon called reciprocity failure. Simply put, it means that, outside a certain interval of exposure times, the sensitivity of film decreases as exposure time increases. Outside this interval, exposure times must be much more than doubled for closing down by each stop. Digital camera sensors behave in a similar way. In addition, with long exposures, noise overwhelms the signal. With both film and sensors, lowering the temperature decreases noise, but a liquid nitrogen-cooled digital camera is not a practical approach for most photographers. Increasing illumination is a way to compensate for a narrow aperture, but also this method is inconvenient. A short flash of illumination 1,000 times stronger than sunlight, for instance, is likely to vaporize a small subject and permanently damage the photographer's sight.

Even if you did follow these approaches, anyway, the devil has yet another trick in store for you.


Quantum theory says that light is both particles and waves. In our case, this means that light interacts with objects in subtler ways than just following a straight line, or being refracted and reflected. In addition to the above behaviour, light rays that pass very close to object edges are bent. This is one of the aspects of diffraction. In the case of a camera lens, diffraction affects light passing close to the edge of optical elements and to the edge of the diaphragm. The latter is especially important when the diaphragm is stopped down. The open area of the diaphragm is proportional to the square of the diaphragm's diameter, while the perimeter of the diaphragm is proportional to its diameter. This means that, when the diaphragm is stopped down, its aperture area decreases more rapidly than its perimeter. In turn, the above means that the portion of light that passes near the edge of the diaphragm and is diffracted grows proportionally. This is usually simplified by saying that the effects of diffraction increase, when we stop down the diaphragm.

Any light that does not travel in a straight line ends up on a "wrong" area of the camera sensor or film. Diffracted light does not spread uniformly, but produces an image with a bright center spot and alternating dark and light rings surrounding it. The end result of diffraction is a loss of resolution and short-range contrast. The physicist George Biddell Airy quantified this with the formula:

where λ is the wavelength, d is the aperture diameter and θ the angle of minimum separation for two points to be imaged as separate. This formula applies at a significant distance from the aperture (which is the case in camera lenses). Since θ is small, and we are primarily concerned with the f-stop aperture, the formula can be written:

where x is the minimum separation of two points on the film/sensor, and f/d is the f-stop aperture. The diameter of the bright center spot of the diffraction pattern up to the middle of the surrounding dark ring is called the Airy disk. Remember that it has nothing to do with air, and that it should be capitalized.

The above formula allows us to calculate the diameter of the Airy disk for the apertures of Table 1. For instance, if we take λ = 420 nm for blue light and an f/32 aperture, the Airy disk is 16.4 μm, or still less than the circle of confusion. In other words, diffraction has no visible effect in this case. If we take λ = 650 nm for red light at the same aperture, the Airy disk is 25.4 μm, or already slightly affecting the resolution.

The fact that really makes things bad for us is that the effective aperture is the one that counts, both in terms of exposure time and diffraction. Therefore, a large portion of the effective apertures shown in Table 1 produces fuzzy pictures to some extent. In Table 1, I framed the borderline values (slightly affected by diffraction) in pink, and those definitely affected in red. If you want to achieve maximum resolution, stay away from these areas.

The same data shown in Table 1 can be summarized as follows, for your convenience (Table 3). For each magnification, use a wider aperture than the nominal one shown below to avoid diffraction as much as possible, and exceed the suggested aperture values only at your risk (i.e., when a higher DOF is worth a visible loss of resolution). Keep in mind that the shown values are computed from theoretical considerations, but in practice, for the best possible resolution, and depending on the performance of the lens you are using, probably you should stay at least 1-2 stops below the shown apertures.

magnification  use a wider nominal
aperture than this
0.1  f/32 
0.2  f/32 
0.5  f/22 
1.5  f/12.5 
8 f/4
12 f/2.8

Table 3. Nominal aperture at which diffraction affects the visible resolution, as a function of magnification (computed for the sensor of a Nikon D200).

As a last note, although there is no known way of bypassing the laws of quantum mechanics, we do have a couple of ways to beat the devil, at least with stationary subjects, and achieve a practically unlimited depth of field in photomacrography (besides using a scanning electron microscope or an atomic force microscope).  I am preparing a page on this subject, and in the mean time you are welcome to check up the entry on focus stacking on Wikipedia, and make a web search on light scanning photomacrography.

web counter