Extending Focus Depth with Photoshop


Today I want to share a trick I use for Extending Focus Depth with Photoshop. It turns out there’s a feature in Photoshop that makes this super easy. I use this technique for lots of different situations but for this article I’ll talk about how it helps me when I’m shooting macro with a long lens.

Macro Photography and Focus Limitations

Macro photography is commonly defined as extreme close-up photography (usually of small items) with a resulting image that is larger than actual size. This kind of photography is best done by getting in as close to your subject as your focus will allow.

Special lenses have a “macro” feature with extended focus range to let you get closer to your subject than a non-macro lens. When you get in close to your subject a small object can fill your image and let you see details that you can’t normally see. In the world of macro photography small subjects look huge. But in the world of close focus photography you need to be aware of how small your range of focus (or depth of field) becomes.

With a wide angle lens your total range that is in-focus can be less than an inch and a half. When you use a longer lens the amount of in-focus area drops quickly. When I use my 200mm macro lens, for example, I have about .25 inches in focus (.12 inches behind the focus point and .12 inches in front of the focus point). It’s even smaller when you’re shooting a camera with a cropped frame sensor. When you’re shooting a relatively flat subject at a right angle you can get an amazing shot that keeps most of your subject in focus. But when you shoot your subject at at an angle you can create a great look where only part of your final image is in focus. Here’s an example of the small range of in-focus area that is typical of a long lens:

You can see that the blue piece of popcorn is completely in focus but everything above and below the horizontal in-focus line is out of focus. I love this look because it can really focus a viewer to look where you want them to look. But sometimes I have to create an image with the entire shot in focus.

Extending your Focus  

When I’m working in my studio I always use a long lens for my macro work. There are two reasons I use longer lenses. The first is to keep geometric distortion to a minimum (wide angle lenses can add lots of distortion) and the second is to give me plenty of room to use studio lighting. Here’s a behind the scenes look at my product photography area:

Here you can see that I have my camera on a tripod and I’m photographing at an angle to the bag of popcorn. My camera is tethered to my laptop (I’m using Lightroom 4 for my tethered capturing) and I have two flashes to light things up. Here’s a look at the bag of popcorn that I photographed in the shot above:

For this shot I focused on the URL in the middle with my camera set to f8. At that aperture I have a total of 1/4 of an inch in focus. Changing the aperture won’t do much since f22 can only get me a total of .71 inches in focus.

The best way I’ve found to get more looking in focus is to take multiple pictures at various focal lengths and bring them into Photoshop to create an image that is in focus from top to bottom. For me that means three shots or more.

Camera Settings for Multiple Shots

With my camera mounted on a sturdy tripod and tethered to my laptop computer I begin by setting up my lights. For my popcorn shot I used a single flash with a softbox for a main light and a second flash with a grid for accent lighting. Because I’m in a studio environment I set my ISO low (I used ISO 200). Next I put my camera into manual mode and I set the shutter speed to 1/200th of a second and I dial in f8. At this point I take some test shots and adjust the power of the lights until I’m happy with how things look.

Next I turn the auto-focus off and I manually focus the lens so that the popcorn at the top of my frame is perfectly in focus. Then I go a little further and I take my first shot. I do this in case the lens calibration is a bit off. Now I turn my focus ring in the opposite direction to bring the top of the frame back into focus and I take another shot. Then I move the focus ring back a little more for the next shot and I continue this until I have the bottom of the frame completely in focus. Finally, I’ll take one last shot with the focus turned too far (again, I do this incase my lens calibration is a bit off). In the case of my popcorn shoot I ended up taking a total of 11 pictures.

Because I’m shooting tethered the images are already in Lightroom. If you’re not shooting tethered you can import the images from your memory card. Here’s a look at my popcorn pictures in Lightroom:

Next I take a close look at the images. In my case the first and the last shot didn’t have anything in focus so I ignored them. I then selected the remaining 9 images and went over to the develop module where I turned on the auto-sync option. Now when I make an adjustment to one picture it’s applied to every image. When I’m happy with how the shots are looking in Lightroom I send them over to Photoshop by right clicking on the filmstrip (at the bottom of the Lightroom workspace) and I select Edit in and I choose the option to open as photoshop layers. Here’s a look at where to do this in Lightroom:

By choosing this option all 9 images opened into a single file in Photoshop and each image is on a separate layer. Here’s how my popcorn shots looked when I opened them in Photoshop (the 9 layers are circled in red):

Now I select all the layers by clicking the top layer and then I hold the shift key down and click the bottom layer. At this point all the layers will be highlighted. Here’s what it looked like when I selected all of the layers in Photoshop (the selected layers are circled in red):

Now it’s time for the cool part. Go to the edit menu and from the drop down menu click Auto-Blend Layers…

A pop-up menu will appear asking you to choose a blend method. I make sure the Stack Images option is selected and I click OK.

At this point Photoshop will look at every layer and decide what is in focus on each layer:

 Photoshop will then create a layer mask for every layer hiding out-of-focus areas and showing the in-focus areas.

The final stage of the automated process involves Photoshop creating a seamless composition. When it’s done you end up with a shot that has everything from top to bottom in focus.

At this point all the images are still selected so I right click in the layer panel and I flatten the image. This will create a single layer with only the in-focus areas from the 9 images we started with.

And that’s all there is to creating an image with everything in focus from top to bottom. And it was done with just a few mouse clicks. How cool is that?

Here’s a few words of caution. If you’re shooting a high resolution camera then this process could take some time. Having a powerful computer can help big time but don’t forget – Photoshop (in this project) looked at 24,000,000 pixels times 9 layers and had to analyze them to find in-focus areas and create masks for each of the 9 layers. That’s a whole lot of calculating to do. The good news is that you don’t have to do much at all. This is a pretty automated process that ends up giving you results that can’t be recreated in-camera.

Here’s one more look at the final image of the multi-colored popcorn:

And that’s all there is to it. By taking multiple pictures with different areas in focus and using the auto blend capability of Photoshop you can create a macro shot with everything looking in focus. And don’t forget – this technique isn’t just for macro shooting. It will also work whenever you have multiple subjects (at different distances from your camera) and you want to create a final image with everything in focus.

Leave a Reply

Your email address will not be published. Required fields are marked *