How-To

Photoshop: Expand Depth of Field (DOF) with Focus Stacking

Featured Image

We promised and we delivered – here’s our very own Focus Stacking tutorial. To all hardcore photo enthusiasts and pros, this is an article you’ll love.

What is Focus Stacking?

Focus stacking (also known as focal plane merging and z-stacking or focus blending) is a digital image processing technique which combines multiple images taken at different focus distances to give a resulting image with a greater depth of field (DOF) than any of the individual source images.

– from Wikipedia

How should I take the photos?

In terms of composition, both the camera and all of your subjects need to remain in the exact same position for all of your images. Take a minimum of two photos with the focus on each one at a slightly different distance. Even if your lens focuses in a way that introduces slight distortion of the out-of-focus areas, Photoshop can align automatically for you, so just concentrate on the photos without worrying about post-processing.

Focus Stacking gif photoshop images photography dof expand

The Automated Method

After transferring all of your images to your computer you need to load all of them into a single Photoshop document. For up to 3 images, opening the first one and then using File > Place for the others is okay. If you have a larger number of photos, however, try File > Scripts > Load Files Into Stack.

photoshop load files into stack script expand dof photography tutorial

A window entitled Load Layers will appear, allowing you to import your images. Press the browse button and navigate to wherever your images are, then select them all and pick Open.

photoshop photography tutorial expand dof load images focus stacking stack

Pro tip: If you put your photos into a separate folder, you can also try Use > Folder.

load images from folder photoshop photography dof expand tutorial images stacking

After selecting the images, you can optionally tick Attempt to Automatically Align Source Images if you think the photos might not be perfectly aligned.

Photoshop photography tutorial loaded images automatic alignment align stack images focus dof

Press OK and watch as Photoshop does the work for you, turning each and very image into a layer.

images to layers script photoshop image photography dof expand focus tutorial

With the top layer selected, hold Shift and click the last layer to have them all selected.

layers selection shift photoshop layers select all dof stacking photography tutorial

Now go to Edit > Auto Blend Layers.

auto blend layers photoshop feature photography focus stacking tutorial

From the newly appeared window choose Stack Images, and leave Seamless Tones and Colors checked.

auto blend layers options seamless tones colors photoshop photography tutorial

Click OK to begin the process (usually from 2 to 5 minutes depending on image size and computer performance).

auto blend images layers focus stacking photoshop tutorial

Represented with a GIF, this is how Photoshop gradually stacks up images:

Blending dof focus stacking photoshop process gif

Then it gives you the final result:

result final photoshop stacking image focus stack photography tutorial

If you’re happy with the final result, you can press a quick Ctrl + Shift + S to save your final image as a new file.

save as keyboard shortcut photoshop

Check out Page 2 for the Manual Method.

The Manual Method

You may not always want to leave Photoshop to do all the work for you. Sometimes it’s best to do things manually, to make sure everything works out the way you want it to. This method works best for up to 3 images, and in this case I’ve only got two. I’ll open the first one…

photoshop open document image import photography tutorial focus stacking manual

…and use File > Place for the second one, making sure both are perfectly aligned.

file place photo place stack layer from photo photoshop photography tutorial focus stacking manual

Optionally, rasterize both of your layers for future edits.

rasterize layer photoshop edits layers panel photography tutorial

Add a layer mask to the top layer with the layer mask button.

layer mask button layers panel photoshop photography tutorial stacking focus dof

With the layer mask still selected, press Ctrl + A to select the entire canvas, and then use Right Click > Fill to fill the layer mask with black.

fill layer mask black layers photoshop tutorial focus stacking

To finish with the filling, press Ctrl + D to deselect. You can now start painting in the elements you want to bring back in focus. In my case – a second marble. Pick White as your Foreground Color

foreground background colors photoshop

…and pick up the Brush tool (B), making sure you’ve got an average sized soft brush.

brush size tool photoshop softness brushing layer mask focus stacking reveal

Paint over the areas you want in order to bring items in or out of focus.

manual focus stacking stack imaged dof expand photoshop softness brushing layer mask focus stacking reveal

Again, when you’re happy with the results, press Ctrl + Shift + S to save your results as a new file.

save as photoshop keyboard combination

Conclusion

Focus stacking can come in quite handy for many situations, including macro photography difficulties and times when you need to achieve something optics can’t help you with. There are a ton of third party programs that specialize in focus stacking, but it’s nice to know Photoshop has it built in as well. Experiment with it and feel free to share your focus stacking creations with us! I created this unrealistic photo using the manual method. And you?

unrealistic photo effect photoshop

For a step-by-step video guide on how I did it, check out my video below:

2 Comments

2 Comments

  1. Ron White

    August 23, 2013 at 4:19 pm

    Hey, Stefan. That’s terrific! I knew Photoshop would do that I’ve been interested in trying it out, but, well, the truth is I’m too lazy. Thanks for showing me how-to and showing it’s not all that hard.k

    ron

    • Stefan

      August 25, 2013 at 1:05 am

      Thanks for your comment, Ron!
      Glad I helped out.

Leave a Reply

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

 

To Top