Maximizing Depth of Field Without Diffraction


So you are out shooting and you want to capture the full scene in front of you – all the way from what is directly in front of you to the background way off in the distance. You know you need a really large depth of field, and you know what you need to do to get it.

You reach for the camera’s aperture control and crank it down all the way to f/22 (or f/32 if your lens allows). That will maximize your depth of field and have your picture looking sharp from front to back.

Or will it?

What is Diffraction?

There is a phenomena in photography called diffraction that has an adverse effect on your pictures, and sets in when you use smaller apertures. What is diffraction? Let me explain.

As you are probably aware, the aperture is the opening in the lens that lets light into the camera. When the aperture is large, light moves freely through the aperture onto the digital sensor. When the aperture is very small, however, light rays spread out from the small aperture onto the digital sensor. This “spread” can cause the light rays to hit adjacent photosites. Essentially, the spread causes the light to hit the wrong photosite and causes blur. The effect is more pronounced in digital sensors with a high density of megapixels since they have smaller photosites. The following graphic illustrates how this works:

Diagram showing how light enters the camera through the lens and results in diffraction at small aperture settings

What’s the result of this to your photography? In a word: softness.

A picture shot at f/22 will not be quite as sharp as one shot with an aperture that is a bit larger. Here is an example of detail from two photos, which are identical except that one was shot at f/8 and the other at f/22:

Example of photos taken with large and small apertures to show the effect of diffraction when using a small aperture on your lens

You can probably see that the f/8 detail is sharper than the f/22 detail.

The example above was shot on a full-frame camera with a 24-105 mm f/4 lens(my favorite)with a minimum aperture of f/22. I also created another example, this time shooting with a 70-200 mm f/2.8 lens with a minimum aperture of f/32.

Example of photos taken with large and small apertures to show the effect of diffraction when using a small aperture on your lens

Again, the f/8 detail is sharper than that shot with the smallest aperture.

By looking at these examples, you can see that diffraction is not just theory, it has real affect on your photos.

Using the Sharpest Aperture

Okay, so now you see that diffraction is a real phenomenon, and you want to avoid it. What is the smallest aperture you should use? And what is the best aperture setting? Unfortunately, there is no one perfect answer. It depends on your sensor size and lens.

To see how it works on your camera and lens, just take the exact same picture at each aperture setting (in 1-stop increments). Be sure to use a tripod so your picture is exactly the same. In addition, make sure you are increasing (making longer) your shutter speed by an equal amount every time you change your aperture so that your exposure stays the same. After you have taken the pictures, load them onto your computer, zoom-in on each, and compare.

If you don’t want to do any testing and just want a quick rule of thumb for avoiding the effects of diffraction, avoid using an aperture smaller than f/11 or f/16 on a full frame camera (if your camera has a smaller sensor, diffraction sets in at even larger apertures). Most experts consider this range something of a maximum. In addition, the sharpest aperture for most people will be about f/5.6 – f/8, or about 1-2 stops smaller than the wide-open aperture setting. When possible, default to using an aperture in this range.

Maximizing Depth of Field with Larger Apertures

You may find yourself wondering how to get a large depth of field without using a very small aperture. Keep in mind that you don’t always need to use the smallest aperture that your lens offers, to get a sufficient depth of field. If you are shooting outdoors, which is generally where you will want a small aperture and maximum depth of field, you should become acquainted with the subject of hyperfocal distance.

Despite its complex-sounding name, hyperfocal distance is just a measure of how close you can focus and still keep the background of your image acceptably sharp. You don’t necessarily need to use the smallest aperture possible, particularly when you are shooting wide-angle. For example, if you are using a full-frame camera with a 20mm lens, even using an aperture of f/8 will keep everything sharp from 5.5 feet in front of you, all the way to infinity!

This shows that you don’t always need to use an aperture like f/22. Get acquainted with hyperfocal distance (or keep a hyperfocal distance chart handy) to see how large you can make your aperture, yet still maximize depth of field.

Focus Stacking

Sometimes, however, you need to break out the heavy artillery and make sure everything – from what is right in front of you all the way to infinity – is in focus. To do that, use a technique called focus stacking.

To focus stack what you do is, take multiple pictures of the exact same thing at your lens’s sharpest aperture setting. Again, you should test your lenses to see what the sharpest setting is for each lens, but if you don’t know it will usually be in the range of f/5.6 – f/8.0. Set your lens to manual focus, and set the focus point on the closest part of the image (nearest part you want in sharp focus). Take the first shot, then repeat the process, gradually setting the focus point further and further away with each shot, until you are focused at infinity. Usually 3-5 shots will cover the entire range of the scene.

When you get your photos in your computer, you will combine the photos in Photoshop to create one file using the sharpest parts of each picture. There are a few different ways to do this:

  • Automatic: Use the Photomerge function to load your photos into Photoshop (File > Automate > Photomerge) and combine the images, making sure that the box to “blend images together” is checked. Photoshop will combine the images into one file and (usually) use the sharpest portions of each image.
  • Partial: You can also load the images as separate layers to one file in Photoshop, align your layers (Edit > Auto-Align Layers), and then have Photoshop automatically blend the layers (Edit > Auto-Blend).
  • Manually: Finally, you can do the process manually if you want complete control over it. Load the images as layers to the same file align the layers. To blend the photos, add a layer mask to the top layer (Layer > Layer Mask > Reveal All) and use a black brush to mask away everything except the sharpest point of that picture. Then merge down that layer (Layer > Merge Down) and repeat the process for each layer. This method will obviously take more time than the first two options above.

At the end of this process, you will have combined the layers such that the sharpest portion of each one is showing. The photo will be 100% sharp from front to back – with no effects of diffraction.

Application to Your Photography

You should be aware of diffraction, but don’t let it scare you away from using the aperture that you need. In particular, there is still a place for shooting with very small apertures. The effects of diffraction – while real – are not that great, and keep in mind that the examples set forth above showing the effects of diffraction were zoomed way in. If we look at the original pictures, can you tell which one was shot at the smaller aperture?

Full photos showing limited effect of diffraction

Can you see any diffraction here? In the top row, the picture to the left was shot at f/22 and the one to the right was shot at f/8. In the bottom row, the picture to the left was shot at f/8 and the one to the right was shot at f/32.

Can you see the diffraction in the images above? I can’t.

Worrying about diffraction should be reserved for those times you are dead set on absolute maximum image quality, or you know you are going to display a large version of the picture. Otherwise, you can still shoot with small apertures and you will likely not notice the difference. In other words, there is still a place for f/22 in this world.

However, on those occasions where it does matter, use a slightly larger aperture. Know your lens’ sweet spot and use that setting. Be familiar with the hyperfocal distance involved and see if you can keep the entire picture sharp at the larger aperture. Where you cannot, use focus stacking, this will ensure the sharpest pictures possible.

Read more from our Tips & Tutorials category

Jim Hamel shows aspiring photographers simple, practical steps for improving their photos. Check out his free photography guides and photography tutorials at Outdoor Photo Academy. The free tips, explanations, and video tutorials he provides are sure to take your photography to the next level. In addition, check out his brand new Lightroom Course where Digital Photography School readers can use the Promo Code "DPS25" to get 25% off!

  • a_eh

    Your solutions might help to limit diffraction, but your scientific explanation/diagram for what diffraction is is a little lacking. That’s not really how it works. The light doesn’t have to bend to make it through a small aperture. Light is actually bent whenever it goes through a small slit. There’s more that is relevant if you explain it properly, including diffraction limits depending on aperture size and sensor pixel size.

  • Well, first of all, let me say I’m glad that the practical solutions, which were really the reason I wrote the article, stand up.

    But I have continued to delve into this, after a little prodding by others, and I realize that you are right – my little intro into diffraction, with my attempt at a simplified scientific explanation, is lacking. I do not mention the spread across photosite boundaries or the impact of sensor/pixel size, for instance. I will work on the scientific background of this some more. So thanks for chiming in to help clarify this issue.

  • I’m wondering why camera manufactures aren’t doing more to help us with this: First, it should be pretty trivial to come with an automatic focus bracketing, similar to e.g. exposure bracketing. Secondly, and perhaps a bit more complex, I would assume that since diffraction is a physical process that can be modeled mathematically, it should be possible to come up with a computational deconvolution that corrects for diffraction. Any ideas why this isn’t happening?

  • That’s a good question. As to the actual correction of diffraction, I have no idea, and I’ve already ventured too far into the realm of science here (I’m just a photographer, and don’t know about things like computational deconvolution). I’m hoping others will chime in on that.

    But it does seem like there ought to be a bracketing feature like the one you describe. The camera manufacturers don’t seem to have grasped the full power of bracketing yet. We are only just now seeing ISO bracketing, and only a very few cameras have that. What you describe would be the same thing, only with aperture, but slightly more complex because you’d need offsetting shutter speed or ISO changes. It would be pretty cool though. My guess is that we’ll see something like that in mirrorless cameras in the next 5 years.

  • Chris Tucker

    OTH simplistically isn’t this one of the reasons your images look different than mine? The ability to adjust, test and adapt is what the use of the manual tools are for. To me at least its part of the art.

  • That’s why I like having M4/3. Not only is it lighter for hiking to the backcountry to do landscapes, the larger DoF that is a drawback in Portraits becomes awesome for HyperFocal landscapes.

  • Bonno

    By the sample picture of the flower, is the f32 better than the f8, changed the pictures?

  • a_eh

    It doesn’t work quite like that. For cropped sensor cameras, you actually hit the diffraction limit earlier (you can see this in lens reviews). It’s all in the sensor/pixel size. With larger pixels on most full frame cameras, the circle of confusion is less likely to hit more than a single pixel. You may feel like you get a deeper depth of field, but that’s because you’re decreasing the effective aperture size with your crop factor… and also increasing your focal length.

  • Tim Brown

    This article is not accurate. Diffraction has nothing to do with the light bending through the hole. Diffraction is the SCATTER of light that happens at the edge of the diaphragm blade. When there is a small hole there is a larger edge-to-hole ratio. So a higher percentage of the light is scattered. The explanation in this article is completely false.

  • Yes, as I mentioned in a prior comment, I did a poor job of describing the scientific basis of diffraction. Rather than bending, it is more of a spreading across photosites (or scattering as you say). I am working to correct.

  • In my view, the f/32 is the softer of the two. That is how it should be anyway.

  • Michiel Sysmans

    There is an app called called DSLR controller you can put on your smartphone. this app allows you to set every setting on your camera (within the setting selected of your camera) but It also comes with a lot of extra options. One of them is bracketing (up to 7 pics I believe where my camera only takes 3) but also with a setting for focusstacking. (anywhere from 2 up to 100 pic I believe) (not sure my phone is broken for the moment)
    So this might be helpful for photostacking and a lot of other things;

    I’m very surprised so few people use it. It’s really good. It gives the ability to make our cameras ‘smart’ I really like it.
    I wonder why nobody on DPS ever talks about it.

    Ps: I do not make any many from it. I’m just saying it because I think it might be helpful. There are probably similar app to do so.

  • robertcanderson

    you’ve apparently made an error in the tags you have placed on your crops of the flower image because the way you have them labelled, the f32 image on the right is significantly sharper than the f8 image on the left which you claim is the better of the two. The f8 one on the left is so soft it’s unusable.

  • Peter

    Also the one on the left (said to be f8) has a larger depth of field, the leaves in the background are more in focus, than the one on the right (said to be f32). Jim I think the Pics have been inserted wrong way, but this does not detract from bringing the point of the article which is explaining to people understanding why some their photo look softer than others because they thought that using a really small aperture would give a great depth field without any loss of quality.

  • walwit

    Good point about focus bracketing, the Fuji XT-10 has bracketing for five different parameters but not focusing.

  • John M. Hudson

    I have been a serious amateur, technically proficient photographer for 45 years or more. Why have I heard nothing about diffraction until the last couple of years? Is this a fairly new realization?

  • I don’t think it is a new realization, but you many not have been aware of it because its impact was more limited until recently. First of all, its impact on a full-frame sensor is much less than that of an APS-C sensor (and now Micro 4/3s, which are effected even more). It is also a function of the number of megapixels spread onto a sensor, so it may not have been as much of an issue when the manufacturers were not able to cram as many megapixels onto cameras.

  • Interesting info for those of us confused by Ansel Adams F64 club. A few years ago I started backing down from F22 to F16, I guess I shouldn’t fear F/ll landscapes.

  • Tim Brown

    The key is that LIGHT – close to the blade edge is scattered – the same at every aperture, even the widest apertures. But on a small aperture there is more percentage of the light coming through that is close to the blade edge. So with a small aperture more of THE TOTAL of light (a higher percentage) is scattered. Because more of THE TOTAL of light is close to the edge. So you see the effect because more of the TOTAL of light is destroyed. It’s about the percentage. What you wrote is entirely different.

  • LFC4SB

    Thank you for your article Jim. It made perfect sense for a layman like me & if it was any more technical I’d probably have stopped reading it. Much appreciated.

  • Great article, It is definitely worth remembering the effects of diffraction when you are trying to increase focus depth. Diffraction can have some positive effects if you want your lights to sparkle.

  • MarineCorpsX

    …John, diffraction is an optical issue, and actually is not connected with a sensor but with lenses. Diffraction existed in film era, too, but 35mm film produced only 20-24mp equivalent on today’s digital, and 645 MF film produced around 50mp equivalent. So, all lenses from film days mostly could resolve this resolutions, so on film diffraction starts even after f/22. In digital era sensor resolution starts to raise very quickly, but lenses didn’t evolve in that direction immediatelly. But last couple of years all lens factories start to produce and sell ‘hi-res’ lenses. That means if you use 36-50 FF sensor with ‘old’ lenses you will see diffraction already at f/11 or even before. But, if you use new ‘hi-res’ lenses you will see diffraction later, at f/16 or even on f/22. So, diffraction is the ‘problem’ of a lens, not a sensor.

Join Our Email Newsletter

Thanks for subscribing!

DPS offers a free weekly newsletter with: 
1. new photography tutorials and tips
2. latest photography assignments
3. photo competitions and prizes

Enter your email below to subscribe.
Get DAILY free tips, news and reviews via our RSS feed