I recommend using Pixel Peeper mode in Photographer’s Friend for the most accurate information on which aperture to start testing from, and it depends on your camera’s sensor and the number of megapixels, which you’ll need to dial into the Depth of Field Calculator settings. You’ll also need to select your sensor format with the Format dial. For the Canon EOS R5 I’ll select 35mm as it’s a full-frame 35mm sensor. If you use a crop factor camera or medium format camera, select the appropriate Format. I then press and hold the Format dial to lock it, to prevent me from accidentally changing it later.

“Does this lens have good DOF?” It is difficult to quantify without specifying an object detail size or image space frequency. The smaller the detail, the higher the spatial frequency needed, and the smaller the DOF the lens can produce. A DOF curve can be used to see how a lens performs over a given depth at a specific detail’s size (Lens Performance Curves). These graphs not only consider theoretical limitations associated with the f/# setting, but also the aberrational effects of the lens design.

Shallowdepth of fieldphotography

OK, so I hope you found that useful. Before we finish I’d quickly also like to mention that if you absolutely must stop down to a small enough aperture to cause your system to become diffraction-limited, it’s not the end of the world. If you are a Canon user, you can consider using Canon’s Digital Photo Professional software and applying the Digital Lens Optimizer, which removes the effects of diffraction very well when detected. Also, my image management and editing software of choice, Capture One Pro, has a Diffraction Correction option under the Lens Correction section which also does a very good job of cleaning up the effects of diffraction when your images are affected. Photoshop and Lightroom also have lens correction in Adobe Camera Raw which removes the effects of diffraction pretty well too. I rarely have to use this option because I’m generally fine with the slighter wider apertures, but it’s good to know what your options are.

If you are testing a zoom lens, to be thorough, it’s a good idea to test at least three focal lengths. The two extremes and then something close to the middle of the zoom range. For example, when I tested my Canon RF 15-35mm lens I shot both 15 and 35 mm shots as well as a series at 24mm. For the 24-105mm lens, I shot at 24mm, 50mm and 105mm.

Last month, in episode 732, we talked about Depth of Field, Hyperfocal Distance, and Infinity, and also touched on the Circle of Confusion, the Airy Disk, and Diffraction. I originally shared how to test your lenses to find their Diffraction Limit around four years ago, but I had yet to go through this exercise with my EOS R5 and new RF lenses, so I decided to talk you through this process again today. This is also relevant right now because I have just released a new version of our Photographer’s Friend app for iOS that includes a new Pro feature called Diffraction Limit Guide Adjustment, so I’ll also share a little information about that today as well.

Note that this is part of the Pro Add-on as it all takes additional work that was not included in the base price of the app, and also not something that everyone will want. The good news is though, if you already bought the Pro Add-on or the Complete Pro Bundle including the Apple Watch add-on, this feature will automatically be activated when you update to version 3.7.1 which is available now in the App Store.

Due to similarity in name and nature, depth of field (DOF) and depth of focus are commonly confused concepts. To simplify the definitions, DOF concerns the image quality of a stationary lens as an object is repositioned, whereas depth of focus concerns a stationary object and a sensor’s ability to maintain focus for different sensor positions, including tilt.

Please select your shipping country to view the most accurate inventory information, and to determine the correct Edmund Optics sales office for your order.

To overcome these issues, cameras and lenses with tighter tolerances must be used. For sensors, some lenses have tip/tilt control mechanisms to overcome this factor. Note that some line scan sensors can have swale, meaning they are not fully flat; this cannot be mitigated or removed via tip/tilt control.

In general, when lenses are focused at short WDs, the large cone angles cause the cones to diverge very quickly on either side of best focus, leading to limited DOF. For objects in focus at longer WDs, the transition rate of the bundles decreases and DOF will increase.

Figure 2 features the same lens as Figure 1a but at a different WD. Note an increase in DOF occurs at longer WDs. Eventually, as the lens focuses on objects infinitely far away, the hyperfocal condition occurs. This condition is reached at the distance in which everything appears in equal focus.

At 50mm diffraction didn’t really start to kick in until ƒ/18, but it got worse slightly quicker and by ƒ/22 it was about the same softness as at 24mm. At 105mm diffraction was relatively weak but slightly noticeable from ƒ/16 and got worse at ƒ/20 and slightly worse still at ƒ/22. From my findings though, I now know that I don’t have to be concerned about Diffraction until ƒ/16, and if possible, I want to avoid using ƒ/20 and ƒ/22. Based on this, I went into the settings of the Depth of Field Calculator in Photographer’s Friend, and adjusted the amber warning slider to +1.6 stops, and also the red warning slider to +0.3 of a stop. As you can see from these screenshots, that puts the actual warning colors displayed so that the aperture dial is green until ƒ/14 then changes to amber at ƒ/16 then to red at ƒ/20.

Focal lengthvsdepth of field

Figure 4a illustrates the ray bundle at the center of an object under inspection at f/2.8 (a) and f/8 (b). The vertical lines represent 2mm increments away from best focus. On each vertical line, a square represents the discrete feature size of single pixel of detail. Figure 4a shows that as the width of the ray bundle spreads out, more rays miss the detail. In Figure 4b, the bundle expands more slowly and the rays all strike the detail which is larger than the bundle diameter for all depths shown.

Here is the series of images from my Canon RF 24-105mm lens at 50mm, so that you can see what I’m talking about. This is the center 1440px of each image cropped from the larger image, so if you click on these to open up in the lightbox you will be able to see the images at 100% and may be able to see the diffraction starting to kick in.

If you don’t have Photographer’s Friend and don’t care about Pixel Peeper mode, then ƒ/8 is still a good starting aperture for your tests, then stop down one third or half stop at a time, depending on your camera, and shoot an image with every change until you reach the smallest aperture of your lens, which is ƒ/22 with most of my Canon RF Lenses.

For your reference, note that I also tested my Canon RF 50mm f/1.2 lens, which has a smallest aperture of ƒ/16 and once again, I really couldn’t see any diffraction until I hit ƒ/16, so I’m pretty happy to leave my warning color guides at these settings. Because the math dictates where the default settings go, and because I’m testing some of the best lenses available, I don’t want to adjust the default settings. I really think people should do these simple tests themselves to really see the effects of diffraction as it kicks in, and if you do use Photographer’s Friend, I hope you find the ability to adjust your warning sliders useful.

However, this issue is independent of sensor size. As the derivation in Equation 3 shows, depth of focus, $\delta $, is heavily dependent on the number of pixels or pixel count, $ p $, and has little to do with array or pixel size, $ s $. As sensors increase in pixel count, this issue is more evident. Particularly in many line scan applications, the large arrays and low f/#s emphasize the need for careful alignment between the object, lens, and sensor.

Focal length and depth of fieldformula

The DOF of a lens is its ability to maintain a desired amount of image quality (spatial frequency at a specified contrast), without refocusing, if the object position is moved closer and farther from the plane of best focus. DOF also applies to objects with complex geometries or features of different height. As an object is placed closer to or farther than the set focus distance of a lens, the object blurs and both resolution and contrast suffer. As such, DOF only makes sense if it is defined with an associated resolution and contrast. Several targets can be used to directly measure and benchmark an imaging system’s DOF; these targets are detailed in Test Target Overview.

In Figure 1, contrast values (y-axis) are seen over a WD range (x-axis) at a fixed frequency of 20$ \small{\tfrac{\text{lp}}{\text{mm}}} $ (image detail). Note the difference in DOF between Figure 1a, which is set at f/2.8, and Figure 1b, which is set at f/4. Also note that there is more usable DOF beyond the best focus than between the best focus and the lens, due to magnification decreasing. The graphs themselves contain different colored lines denoting different sensor positions. These types of asymmetric DOF curves are common in fixed focal length lenses.

The red cone in Figure 3 is an angular representation of the system resolution. Where the lines of the red cone and dotted black cone intersect defines the total range of the DOF. The lower the f/#, the faster the black dotted lines expand, and the lower the DOF.

With the megapixels set to 45 and Pixel Peeper mode enabled in the settings, and also ensuring that the Diffraction Limit Guides are turned on for the Airy Disk label and aperture dial, we can then adjust the aperture until we see the dial change from green to amber. The last green aperture is where we’ll start to test from as we know that this should not be displaying any signs of Diffraction. With my camera details dialed into the settings, I see that my starting aperture is ƒ/8, so I’ll set my camera to ƒ/8 for my first test shot.

Changing the f/# of a lens changes DOF, shown in Figure 3. For each configuration shown in Figure 3 there are two bundles of rays. The bundle represented by dotted black lines shows how well the lens is focused. As an object moves away from the best focus position (where the dotted lines cross), object details move into a wider area of the cone. The wider the spread of the cone, the more the image blurs into the surroundings. The f/# of the lens controls how quickly the cone expands and how much information or detail is blurred together at a given distance. Figure 3a shows a lens with a shallow DOF, where Figure 3b shows a lens with a large DOF.

Figure 9 shows the change in MTF performance at the corner of the image for this 35mm lens assuming 25µm of tilt, seen in Figure 8. Figure 9a shows the new performance of the lens at f/2.8; note the decrease in performance from Figure 9a. Figure 9b shows the performance shift at f/5.6, which is minor compared to 9a. Most importantly, the lens at f/5.6 will now outperform the one at f/2.8. The drawback to running systems at f/5.6 is three times less light relative to f/2.8 and this can be problematic in high speed or line scan applications. Finally, if the sensor is tilted about the its center, performance decrease occurs at both the top and bottom of the sensor (and the corresponding points in the FOV), since the ray bundles expand after the best focus. No two camera and lens combinations are identical. When building multiple systems, this fact can manifest at different degrees of magnitude.

To make exposure easy, I use Aperture Priority mode for this, and I set the ISO to 100. High ISOs can cause the image quality to degrade as well as Diffraction, so it’s better to avoid auto-ISO. In Aperture Priority mode though, your camera should automatically adjust the shutter speed for you as you stop down the aperture. I also use a two-second timer so that I can take my hand away from the camera during the exposure to avoid shaking the camera.

Figure 7 shows a 35mm lens using 470nm illumination. Figure 7a is set to f/2.8 and Figure 7b is set to f/5.6. Both graphs go out to 150$ \small{\tfrac{\text{lp}}{\text{mm}}} $—the Nyquist limit of a sensor with 3.45µm pixels. It is easy to see that the performance of Figure 7a is far better than Figure 7b, using this lens at a setting of f/2.8 provides the highest level of imaging quality in a given object plane. However, as discussed in the previous section, sensor tilt will negatively impact the image quality produced, and the higher the number of pixels, the more pronounced the effect.

Deepdepth of field

Relationship betweenfocal length and depth of field

The tests are easy to do, and although I used an old Lens Align tool that you can see in the above photo, you can just use a steel rule or even just an open book with a page of text. I like the Lens Align tool because it is easy to vary the angle of the rule and it has lots of text and numbers along the rule to help you to evaluate sharpness. Although we’d usually be looking to see where the focus falls on the rule, for Diffraction Limit testing the point at which you focus is less important. We’re just going to check for a lack of sharpness across the entire image as we stop down the aperture.

Figure 5 shows the same concept as Figure 4, but the cones represent multiple points in the FOV. Each detail and subsequent space represent one line pair. The overlap in the bundles in Figure 5a shows how the information blends together faster than that of Figure 4b and shows how two different object details can blur together due to a lower f/#. In Figure 5b, this does not occur due to the higher f/# of the lens.

Depth of fieldphotography examples

In addition to the amazing content already available, Martin will be writing for the Journal of Wildlife Photography in the coming months. Stay tuned!

As we discussed in episode 732, the depth of field in our images gets deeper as we stop down our aperture, so ƒ/11 has a deeper depth of field than ƒ/8, and ƒ/16 has a deeper depth of field than ƒ/11. The problem with stopping down the aperture for deeper depth of field though, is that it forces the light through a smaller hole, and when you force light through a small hole, the Airy Pattern starts to get disturbed and spreads out, causing it to overlap the neighboring Airy Disk pattern to the point that the image is considered no longer resolved, as I’ve shown in this diagram.

Figure 8 analyzes the depth of focus for the two cases in Figure 7. In both cases, the far right vertical line is at the best focus for the full image. Each semi-vertical line to the left of best focus represents a position 12.5µm closer to the back of the lens. These simulate the positions of the pixels, assuming a tip/tilt of 12.5µm and 25µm respectively from the center to the corner of the sensor. The blue ray bundle shows the image center and the yellow and red ray bundles show the corners of the image. The yellow and red bundles represent one line pair cycle on the sensor assuming 3.45µm pixels. Notice in Figure 8a, that for f/2.8 there is already bleed-over between the yellow and red ray bundles at the shift to the 12.5µm tilt position. Moving out to 25µm, the red bundle now covers two full pixels and about half the yellow bundle as well. This causes significant blurring. In Figure 8b, for f/5.6, the yellow and red ray bundles stay within one pixel over the full 25µm tilt range. Note that the blue pixel’s position does not change, as the tip/ tilt is centered on this pixel.

The calculated warning points are pretty accurate, but how much you allow this to concern you depends really on how much Diffraction you are seeing in your images, and this is both why I like to test my lenses, but also with this latest release, why I wanted to be able to adjust the kick-in points of the warning in Photographer’s Friend.

As details get smaller (represented by a smaller red cone), the bundles in Figure 3a and 3b move closer together. Eventually, increasing the f/# too much causes smaller details to blur due to reaching the lens diffraction limit, since the limiting resolution of the lens is inversely proportional to f/#. This limitation means that while increasing the f/# will always increase the DOF, the minimum resolvable feature size (even at best focus) increases. For more information on the diffraction limit and its relationship to f/#, see The Airy Disk and Diffraction Limit. Using short wavelengths helps to salvage some of this resolution. Learn more about how wavelength affects system performance in MTF Curves and Lens Performance. Note that this diffraction effect is not viewable in Figure 3, but that it is mentioned here as something to mind.

Shallowdepth of field

Once you’ve shot an image for each aperture from the starting aperture to the smallest aperture available on your lens, you’ll then need to transfer your images to your computer and open them up in your usual image editing software and evaluate the sharpness. With the high-resolution displays that we have these days, I generally find that I have to zoom in to around 200% to really see the sharpness, and as I worked through these images shot at 24mm starting at ƒ/8 then working through each smaller aperture, the first noticeable degradation in sharpness I could see was at ƒ/16. A certain amount of diffraction kicked in right there, and the image got gradually softer towards ƒ/22, although we are talking a very small amount.

With your camera on a tripod, line it up with the Lens Align tool or whatever you are going to use in your tests, and pick a point at which you are going to focus, just as a reference.

This post is unlocked for non-Patrons as it is a sponsored post or advertising Martin Bailey Photography products. If you found it useful and would like to unlock all other posts please click the button below. Thank you for your support!

Based on my Pixel Peeper calculations which I added to Photographer’s Friend, around four years ago I realized that I could calculate the diffraction limit based on the size of the Airy Disk as it grows with the decreasing size of the aperture, and I provided Diffraction Limit Warnings in the form of traffic light coloring of the Airy Disk label, and the Aperture dial, which is responsible for the limitation. Unless you have changed these colors with the theme customization feature, green will show you that you don’t need to worry about Diffraction. Orange or amber shows when Diffraction will probably start to show itself and red alerts you to the fact that that you will almost certainly be seeing the effects of Diffraction in your images. These color warnings correspond with the Well Resolved, Just Resolved, and Not Resolved Airy Patterns in the diagram.

Focal length and depth of fieldphotography

Depth of focus is the image-space complement of DOF and is related to how the quality of focus changes on the sensor side of the lens as the sensor is moved, while the object remains in the same position. Depth of focus characterizes how much tip and tilt is tolerated between the lens image plane and the sensor plane itself. As f/# decreases, the depth of focus does as well, which increases the impact that tilt has on achieving best focus across the sensor. Without active alignment, there will always be some degree of variation in the orthogonality between the sensor and the lens that is used; Figure 6 shows how this issue arises. It is generally assumed that problems involving depth of focus only occur with large sensors.

Image