Using Focus-Stacking to Avoid Lens Diffraction

by Kyle McDougall | November 9, 2012

© Kyle McDougallOne of the most important parts of a successful landscape image is sharpness. This is one of those things that you HAVE to get right in camera—there’s no fixing an image that is lacking sharpness in Photoshop. A lot of factors are at play when it comes to controlling the depth of field in an image, including the focal length of the lens being used, chosen f/stop, distance to subject, and more.

Many people believe that by shooting with the smallest f/stop possible they will have a pretty good chance of everything being sharp from foreground to background. While sometimes this is true there are negatives to this approach, the most significant one being lens diffraction. Every lens has a certain f/stop that it resolves detail best at, and once you stop down past that point you start to lose sharpness. I recommend setting up your camera on a tripod and taking some test shots at different apertures so that you can see the effect of this in person. While the difference might not seem extreme, it’s the small details that count, and when you’re printing your images every bit of detail matters. For more examples of lens diffraction, check out this article on Luminous Landscape.

Photoshop screenshot © Kyle McDougall

My first image I shot at f/8, which is lacking sharpness because of the close f/g subject and not a large enough depth of field.

With my Zeiss 21mm ZE I tend to shoot at no smaller of an aperture then f/11. A lot of the time this leaves me lacking the depth of field required to achieve acceptable focus from the extreme foreground to the background. This is where focus stacking comes into play. Focus stacking is the method of layering or “stacking” a series of images that are focused at different points throughout a scene and blending them together. Most of the time I will take three shots—one for the background, one for the middle and one for the foreground—although this can vary depending on the image. While the thought of blending detail throughout three images might seem like a labor-intensive process, Photoshop has an automated way of doing it that almost always produces great results.

Autumn leaves up-close © Kyle McDougall

The extreme right corner of the foreground for the image focused for the foreground.

Foreground for background focused image © Kyle McDougall

The extreme right corner of the foreground for the background focused image.

Background at 100% of image focused for background © Kyle McDougall

The background at 100% of the image focused for the background.

Background at 100% of image focused for the foreground © Kyle McDougall

The background at 100% of the image focused for the foreground.

The process goes like this:

  1. Open all the images in a layer stack in Photoshop, one above the other (A quick way of doing this is to open Adobe Bridge, highlight the images and go to Tools>Photoshop>Load files into Photoshop layers).
  2. Highlight all the layers and go to Edit>Auto Align Layers
  3. Once the layers are aligned go to Edit>Auto Blend Layers
  4. Photoshop will automatically create layer masks for each image allowing the detail to show through.
  5. You will need to crop the edges of your image slightly as there will be a slight blur from the aligning/blending.
  6. I always scan over the image at 100% magnification to check for any areas that may have had an uneven blend. Photoshop usually does a really good job but it never hurts to double check.
Photoshop layers

For this particular image I used a series of four shots focused throughout the scene from foreground to background.

Photoshop layer masks

Photoshop will automatically create a layer mask for each layer revealing only the sharp detail in each.

Then you’re done! This is a fairly simple process that once you get the hang of will be extremely valuable for your photography. Being able to squeeze the best detail out of our lenses and cameras is key. Obviously there are other options to remedy the diffraction issue such as shooting with tilt/shift lenses but this is a great alternative. Focus stacking is something that with practice you can phase into your workflow helping you to further over come the limitations of your equipment.

Final sharp image © Kyle McDougall

The final image tack sharp from foreground to background ready to be printed.

About the Author

Kyle McDougall is a professional landscape photographer based out of Ontario, Canada. He strives to showcase the spirit of the land in hopes that others can both re-connect and grow a deeper appreciation for the wilderness. With training in both still photography and motion picture film Kyle has had the opportunity to develop his skills through both mediums. His career has taken him across North America from the wilds of Alaska to the shores of the East Coast working as both a cinematographer and photographer for television and print media. His goal is to inspire and educate others artistically, creatively and emotionally through images, workshops and writing. To view more of his work please visit his website:

4 thoughts on “Using Focus-Stacking to Avoid Lens Diffraction

  1. Thanks for the advice. I use focus stacking frequently on macro subjects, but had not thought about this technique for landscapes. I definitely have images that would have been strengthened with this. Looking forward using it.

  2. There have been a few instances where I have had some minor areas that didn’t blend properly that I was able to fix by manually painting white or black on to the layer masks to either blend in or out detail. Keep in mind that all Photoshop is doing is creating a structured mask for each image to reveal or hide detail. You can alter these masks and choose where you want detail revealed/hidden.

    This method will work for some images, and for others it may not. It all depends on the amount of detail and where the blend “line” falls in relation to the flawed area.

    I hope this helps, glad you enjoyed the article!


  3. Thanks for great advice. If you scan the blended image at 100% and find a line or area of discontinuity, what is the best, fastest remedy?