DOF - Demystifying the Confusion

Depth of field is important for maintaining focus across the depth of an image.   Depth of field describes the range of focus that appears sharp in a photograph for multiple subject planes at different distances in a scene.   Depth of field is not the same as depth of focus.   Depth of focus describes focus at the film plane.

The primary variables that affect depth of field are the focal length of the lens, the aperture setting, the subject or focus distance, and a subjective factor called the circle of confusion, abbreviated as the CoC.   The circle of confusion describes the image resolution needed.   There are additional considerations for close up (macro) photography.

The DOF metrics can only be calculated after the desired CoC has been determined.   Since I intend to cover the CoC more extensively, I will simply introduce the basic DOF formulas and move on quickly.   The hyperfocal distance is the focus point where the depth of field covers the area between one half of the hyperfocal distance to infinity.   If the hyperfocal distance is 10 feet everything from 5 feet to infinity will be in acceptable focus when you focus the lens at 10 feet.

If you focus in front of or behind this hyperfocal distance, the near focus limit and far focus limit need to be recalculated.   The formulas are shown below.

Figure 1

All measurements must be in the same units, millimeters, feet, or inches.
lens focal length aperture f-stop
circle of confusion focus distance (subject)
hyperfocal distance NL near distance for acceptable sharpness
FL far distance for acceptable sharpness   

Circle of Confusion:

The circle of confusion (CoC) is the most misunderstood and controversial variable.   Basically it describes the smallest image element that retains identifiable details.   This varies with the distance from the object in primary focus.   A normal human eye can distinguish 5 line pairs per millimeter at a distance of 25 cm or 10 inches.   The resolving power of the eye is approximately inversely proportional to the viewing distance.   As the distance is doubled, the discernable line pairs are halved.   The converse is also true.   The normal viewing distance for a print is usually expressed as approximately equal to the diagonal size of the print.   Thus, a 4x6 print is normally viewed at about 7 inches but an 8x10 would likely be viewed at about 13 inches.   The captured image is usually much smaller, so it’s resolution must be much higher.   But, it is the image resolution that we care about.

The image resolution needed does not change just because you create a larger print.   It does change if you assume a closer or further viewing distance.   Or if you assume the viewer has better than normal eyes.   But this is because you have changed the viewing assumptions for the printed image, not because of the image magnification.   In other words, if you want to create a 20x30 inch print to be viewed at the normal 36 inches you only need 1.4 lp/mm.   But if you want to view it at 7 inches you need 6.8 lp/mm, the same as is required for a 4x6 inch print.

Using the generally accepted viewing resolution of 5 lp/mm at 250mm the print CoC yields a circle of .2mm on a 250mm diagonal print.   A theoretical print that measures 250mm across the diagonal is would be approximately 5.5 inches by 8.2 inches.   For this case the image magnification required is simply 250 divided by the image diagonal.   Again, the CoC is simply the reciprocal of the resolution.

Therefore: ImageCoC = (1 / ViewingResolution) / (250 / ImageDiagonal)

For 35mm film the image diagonal is 43.3mm so the magnification is 5.78.   The print CoC divided by the magnification gives an answer of .035 for the image CoC.   You can do the math for any size print at its corresponding resolution requirement and the answer will be the same.   Change the viewing resolution and you will get a different answer.

That said, many folks base their 35mm film DOF calculations on a CoC of .030mm.   This is a matter of preference that reflects a viewer capable of discerning 5.7 lp/mm or a viewing distance of 9.8 inches for an 8x10 print.   This is just a slightly more critical assumption about the viewing resolution.

Obviously the physical size of a digital sensor has a direct bearing on the image magnification required.   The same math is used for the CoC at any image size. Or you can use the published cropping factor for your digital camera.   For a Nikon D1X sensor at 15.6x23.7mm this is 1.5.   Thus the equivalent CoC values are .023mm and .020mm respectively.

Print enlargement may present other problems but they are not related to DOF.   This is why large format films were necessary in the early days of photography and why medium format films are still the choice of many professionals for artistic wall-hanging prints.   They are frequently scrutinized at much closer than normal viewing distances.

Pixel Size Constraints:

The smallest size of the image CoC may be limited by other factors.   For digital sensors, the CoC cannot be smaller than the physical size of two pixels (image elements).   Obviously nothing smaller can be resolved.   Typical pixel sizes for high resolution digital cameras are in the range of .006 to .012mm.   These sizes yield resolution numbers of 83 lp/mm and 43 lp/mm respectively.   These equate to CoC values of .012 and .023mm.   A similar effect is unavoidable with film emulsions since the grain size determines the size of an individual image element.   The typical “graininess” of film varies from .004 to .018mm.

The bottom line is that your selected target CoC for DOF objectives should not be smaller than the image elements can capture.

Optical Limitations:

Lens artifacts may be a limiting factor as well.   These artifacts are typically more prominent in very long focal length (telephoto) and very short focal lengths (wide angle).   They are also more likely with extreme zoom ranges and at the far ends of the aperture range.   A lens that is fully corrected for all other aberrations is known as diffraction limited.   If it is not diffraction limited you should consider another lens.

Diffraction is a phenomenon of the wave nature of light.   It becomes apparent with very small apertures or when light travels beside a knife edge.   Optically it manifests itself as ripples or rings introduced as the light passes the edge of any opening.   This is similar to the waves produced by dropping a pebble on the surface of water.   It also affects the size of circle of light from a pinpoint light source.   This is sometimes called the point spread function.   Diffraction is not related to refraction so it is not related to lens quality and cannot be corrected by lens design.

Strictly speaking, diffraction is a function of the physical size of the aperture.   Since an f/16 aperture is larger for a 300mm lens than for a 50mm lens one might expect less diffraction.   But the diffraction pattern is angular and the distance between the aperture and image plane also changes with the focal length.   The two factors have equal and opposite impact so the only variable remains the photographic f-stop.   Note that this does not apply to a telescope, which produces a virtual image instead of a projected image.

Diffraction Limits:

The diffraction limit is dependent on the wavelength of the light and the f-stop.   It is calculated as the size of an Airy disk (Sir George Airy).   This describes the size of a circle from a point of light as it passes the edges of the aperture.   Fundamentally, as you decrease the aperture size (increase the f-stop) the size of the Airy disks increases.   An Airy disk can also be called a blur circle at the image plane similar to the CoC for DOF.   The simplified calculation (estimation) is 1500 divided by the aperture.   Thus, f/8 yields .005 mm and f/64 yields .042 mm.   The relationship between the size of the Airy disk and resolution is known as the Rayleigh criteria.   Since it takes two of these points of light to define resolution the respective resolutions are 100 lp/mm for f/8 and 12 lp/mm for f/64.   Obviously, stopping down the aperture to increase depth of field can lead to increased diffraction that blurs the entire image.   This is demonstrated in the following table.   Remember, the target CoC for 35mm is .030 and for digital DX it is .020.

Aperture f/2f/4f/8f/11 f/16f/22f/32f/64
Airy disk .0014.0027.0054.0074 .0108.0149.0217.0433
lp/mm 3691859267 46342312
Equivalent CoC .0027.0054.0108.0149 .0217.0298.0433.0866

Most photographers would agree that 35mm cameras become diffraction limited at f/22.   At smaller aperture sizes diffraction trumps depth of field and the overall image loses resolution.   For a typical digital sensor size the diffraction limit is a factor at f/16.   Diffraction limits are less significant with medium and large format cameras.   This is only because there is less need for enlargement therefore the CoC values can be relaxed.

In an attempt to illustrate the effects of diffraction, I set up an experiment shooting the same image and changing the aperture only.   The target was two engineering rulers offset by about 60°.   The image plane was 26 inches from the bottom ruler.   All images were opened in Photoshop CS with no adjustments.   They were all cropped to show the same 800x225 pixel area.   They were then all copied to a single canvas.

The images were shot with a Nikon D1X in aperture priority mode, set on a tripod and focusing rail.   The anti-shock mirror setting was on.   The lens was a Nikkor 60 mm f/2.8 macro but well outside the macro limits.   Focus was set manually and unchanged during the shots.

Figure 2

The affects of aperture on DOF can be seen, but the objective of this series was only to demonstrate diffraction limits with the DX format sensor size at small apertures.   The first shot at f/4 was the trickiest.   I needed the focus rail to get the focus plane at the junction of the two rulers.   For the record, the smallest tic marks on the top ruler are every .0167 inches and the bottom ruler is marked every .02 inches.   At f/8 you should clearly see the positive effects of DOF.   At f/16 you should be able to see improvement all the way out to the 8 and 28 number markings on the top ruler.   But the smaller tic marks did not see the same improvement.   At f/32 you should be able to see the overall softness that effects both the smallest tic marks and the larger numerical markings.

In order to see this clearly, you need to view the full image in a separate browser window at 1:1 by following the image link.   It does demonstrate diffraction, but I have to admit that it is more subtle and difficult to show than I expected.   On the other hand, it does illustrate why some of my D1X images at small apertures are much softer than I anticipated.

Image cropping:

Technically the CoC should be adjusted for cropping if the aspect ratio of the sensor is different than the aspect ratio of the print.   Technically true, but unless you are doing a radical crop from square formats or to panoramic formats this is usually insignificant.   If you are doing radical cropping, use an adjusted image format aspect ratio that matches the target format to calculate the CoC.

Depth of Focus:

Depth of Focus describes the distance away from the focal plane that an image may be and still meet a given resolution specification.   It is also known as the focus spread.   It is the acceptable distance if front of or behind a given image plane for a given circle of confusion and f-stop.   It is measured in millimeters and calculated by the formula D = 2cf.   The net result is that depth of focus decreases with a smaller CoC or a smaller f-stop.   At f/2 and a CoC of .020 the margin for focus error at the image plane is only .08mm.   At f/8 and CoC .030 the focus spread is .5mm, a much larger margin.   The out of focus effects at the image plane are similar to those described by depth of field.   The difference is primarily a matter of scale.

This was typically calculated to determine how much warp or buckle could be tolerated for film media.   It also demonstrates the fact that focus tolerances are much smaller for smaller image formats (smaller CoC) at large apertures (smaller f-stops).   Of course human errors and lens manufacturing tolerances can also affect focus.   An out of focus image is going to make an out of focus print.

Close-up Photography:

When you focus on very close objects (macro) there are other considerations that need to be factored into the formulas above.   These are based on the reproduction ratio, usually a number from zero to one.   For example at a reproduction ratio of 1:1 an f/8 setting becomes an effective aperture of f/16.   Calculations for DOF, diffraction, depth of focus and even exposure are all affected because the lens focal plane has moved significantly away from the image plane.   You need to use the effective aperture instead of the selected f-stop.   At normal focusing distances this effect of lens movement is insignificant.

Teleconverters and Extension Tubes:

Obviously if you are using a teleconverter or an extension tube, you need to use the effective focal length and effective aperture as documented for any DOF calculations.

Conclusions:

The DOF formulas net out to four main variables.   These are the focus distance, aperture, focal length, and the size of the image plane.   The first variable one would normally fiddle with is the aperture.   However, you can only stop down so far before you run into diffraction limits and an overall fuzzy image.

You can increase the distance to get more DOF.   But this changes the field of view so you would typically switch to a longer focal length to get the same image cropping.   You wind up with essentially the same DOF.   If you don’t zoom in, any subsequent image cropping results in additional enlargement and overall fuzziness.   Oh yes, you just circled around to the same DOF again.

You can change to a larger image format, which should give you more DOF.   But the field of view changes even more dramatically.   This time you find that you need both a longer focal length and typically a closer subject distance.   These ultimately result in an actual decrease in DOF.

In other words, this can be a delicate balancing act.   Especially for close up macro shots.   For portraits, a DX format would imply shorter focal lengths or increased distances making it more difficult to blur the background.   A larger format implies longer focal lengths or decreased distances making it much easier to blur the background.   For distant landscapes, with an equivalent field of view the DX format will usually yield greater DOF.  

Figure 3

This entire discussion of technical minutia is based on a critical seed value for DOF calculations that is subjective to begin with.   This is the CoC.   Photographers and critics tend to view the print at closer than normal viewing distances.   So it is reasonable to want to use the more critical values.   For extreme photography, the first thing that needs to be determined is the assumed viewing distance for the print.   That will determine the print resolution needed.   This can then be matched to the corresponding image resolution requirements.

As the print size increases the viewing distance should increase proportionally.   As the viewing distance increases, the resolution necessary decreases proportionally.   So the required image resolution remains the same.   Thus, there is no limit to the physical size of a print unless you change the viewing assumptions.

Just don’t forget to consider the other limiting constraints such as the image (film resolution or pixel size) and diffraction limits.   If any of these are larger than the desired CoC you need to reconsider the magnification requirements.   Relax the viewing distance or use a larger image plane.

As with so many considerations in photography, one should always avoid extremes.   Digital cameras with small sensors are more likely to be affected by diffraction limits.   35mm film is only slightly more tolerant.   Medium and large formats are least affected by diffraction limits.   This is simply because the larger image format needs less magnification to create a print.

Other Techniques:

Some lens barrels are marked with lines showing the DOF at various f-stops and focusing distances.   However these cannot be used if the markings are for 35mm film but the lens is on a digital camera.   For this reason many new lenses have no markings at all.

Some cameras have a DOF preview mode.   A button on the body allows the aperture to be stopped down to a desired setting while viewing the scene through the viewfinder.   But this image is rather small and closing the aperture can make it quite dark.   This makes it somewhat difficult to evaluate with the unaided eye.

References:

DOF calculations are covered in depth in most photography books, books on optical theory, and discussed on many Internet sites.   There are also a variety of DOF calculators available.   I have also created an HTML forms based DoF Calculator

I have included the formulas I used for my DOF, CoC, and Airy disk calculations used while researching this article in an Excel spreadsheet available  here.

I hope you also gained some new insight from this article.   If you have any comments, or suggestions, I would welcome your input.   Please send me an  Email


Rags Gardner
Rags Int., Inc.
204 Trailwood Drive
Euless, TX 76039
(817) 267-2554
Send Email
www.rags-int-inc.com
February 4, 2004

This page last updated on: Saturday November 01 2008
You are visitor number 63,531 since 02/05/04