How to do Focus Stacking in Photoshop for a Seemingly Infinite Depth of Field


Whenever you do macro or close-up photography you usually have to choose very carefully what you want to keep in focus. This can also happen when you want to shoot a landscape and you want to include an element close to you but you end up with a blurry background.

So it seems that doesn’t matter if you go big or small you always have to make compromises regarding the depth of field. However, there is a post-production way around it, stay with me and I’ll show you how to do focus stacking!

Focus Stacking for an Infinite Depth of Field

First, what is depth of field?

Depth of field, commonly referred to as DoF, refers to the distance between the first and last object that appears in focus or sharp within an image. It covers the space in front of and behind the focal plane, in other words where you put your focus.

How broad this space or distance is can be determined by different factors: the aperture, the focal length of your lens and the physical distance between the camera and the subject.

Even if you have these three factors to move around in order to expand your depth of field, there are certain conditions that just won’t allow you to get as much DoF as you need. This is where Photoshop comes in, when you need to achieve an impossible or seemingly infinite depth of field.

While this is a post-production process, you need to consider and get it at the shooting stage as it’s not something you can achieve by fixing your photo later. You need to prepare several photos that you’ll stack together in order to create one fully focused image.

So basically what you need to do is shoot the image with different parts in focus. Everything else needs to remain the same, this means the same framing and settings and you ONLY adjust your focus in each shot.

Focus Stacking for an Infinite Depth of Field - source images

A few tricks for shooting images for focus stacking

  • For best results in the post-production, it’s better to have good material to work with so I recommend using a tripod so that the framing is exactly the same in each image.
  • Adjust the focus manually and in order (like from closest to farthest) so that you don’t lose track and have a shot where every area of the photo wasn’t sharp at some point during the shooting. Think of it as bracketing the focus.
  • The more photos you take the better so that Photoshop will have enough information to form your final image.

Getting Started

Okay once you’re back at home base, download your photos to the computer. The first thing you need to do is open them all into the same file in Photoshop. You can do this by going to Menu > File > Scripts > Load Files into Stacks.

In the pop-up window, set it to use Files and then with the Browse button choose the set of photos you took. Check off the option “Attempt to Automatically Align Source Images”, especially if you didn’t use a tripod. But even if you did it’s useful to keep it checked to compensate for the focus breathing which is the change in scale when you re-adjusted the focus for each photo.

Focus Stacking for an Infinite Depth of Field - load images into a stack

Once you have them all, just click Open and Photoshop will load them in the same file, each on a separate layer. The filenames will become the name of each of the layers.

Note: If you forgot to check the Attempt to Automatically Align Source Images in the step before, you can always do this by selecting the layers and going to Menu > Edit > Auto-Align.

Focus Stacking for an Infinite Depth of Field - layers

Blending the layers

Now, select all of your layers. You can do this by clicking on the first one, then holding Shift+Click and click on the last layer. That way everything in between will get selected too. Now go to Menu > Auto-Blend Layers. A pop-up window will appear, check the “Stack Images” option and leave the Seamless Tones and Colors checked as well.

Focus Stacking for an Infinite Depth of Field - auto blend

From there Photoshop will do all the work so you just have to be patient.

Focus Stacking for an Infinite Depth of Field

I recommend that you zoom in and check the edges as you can find some problem areas that may require you to copy paste from the original files for fine-tuning, like this:

Focus Stacking for an Infinite Depth of Field

Once Photoshop has your image pasted together, you can go to Menu > Layer > Flatten Image to compress all the layers into one. Finally, make any adjustments you need to the exposure or contrast to get your final result.

Focus Stacking for an Infinite Depth of Field

This is the best way of doing focus stacking in Photoshop. However, if you find yourself outside the studio, without a tripod and unprepared, you can still give it a go. Just try to stay as steady as possible or you won’t achieve the required result.

For example, I took two photos, one where the small sculpture of the head in the foreground was focused and one where the background was focused. It was done without a tripod or any care about it leaving all for Photoshop to fix and as you can see it wasn’t able to align them.

Focus Stacking for an Infinite Depth of Field

However, in these examples, I also used only two pictures and no tripod but I was very careful and did my best not to move at all except for my two fingers turning the focusing ring. Of course, it’s impossible to actually do that but it was good enough for Photoshop to do an acceptable result on my images.

So it’s not ideal but it can be done, never prevent yourself from trying!

Focus Stacking for an Infinite Depth of Field

Read more from our Post Production category

Ana Mireles is a photographer and artistic researcher. She has been awarded and exhibited in Mexico, Italy, and the Netherlands. Through theory and practice, she explores the cultural aspect of photography, how it helps us relate to each other, the world, and ourselves. She has also a passion for teaching, communication, and social media. You can find more about her and her work at her website or acquire some of her works here.

  • Anne D. Allen

    Make monthly Up to $5037 by working with U.S. Bancorp from comfort of home. There is absolutely no one saying to you what to do,use your laptop with internet connection, carry it to sea beach or even a park or mountain, and complete your work peacefully with nature. In Online earning, just take your laptop along with you on your family trip. Here’s the best way to start ->->

  • Ashton J. Nolan

    Do you want to know reliable on-line income opportunity to obtain atleast $22500 once a month? Then you are at the correct place due to the fact I am obtaining that much since 6 months now. You will be your own boss and travel the world with your friends and relations at any time and enjoy some time together with them. You can take your laptop with internet connection in countries you want to travel and check your on-line work anytime you choose. Here’s the only way to start ===>

  • Sheilah K. Penick

    Do you need authentic on-line making money opportunity to get atleast $21300 each month? Then you are at the best place because I am getting that much since six months now. You are your own boss and travel the entire world with your loved ones at any time and enjoy your time along with them. You can take your laptop with net connection in locations you desire to travel and monitor your online work whenever you desire. Here’s the best method to start >>>

  • Dave Hallberg

    The article is fascinating but when I attempted to use this technique I was unable to do so. I have both Photoshop 10 and 14 and was unable to locate “scripts” action under the file tab. Is there an Add on that I am missing or are my versions too old?

  • Ana Mireles

    Hi Dave, I’m happy to see that you liked the article and decided to try it! I’ve been doing some research on your question and I don’t think it’s about how old the version is, I went back to CS6 (even before the CC around 2012) and it’s available. However you can do the Stacking manually by opening a new document and dragging photo by photo inside or doing copy pasting and this will put them on as layers. Then continue with the steps from the tutorial normally. I hope this solves your question 🙂

  • Dave Hallberg

    Thank you for the update. I will give it a go.

  • Sandra S. Leahy

    I generally generate roughly $20,000-$21,000 monthly through online. I lost my job after doing work for the same company for several years, I required reliable source of income. I was not researching for the “get rich overnight” packages you see all over the net. Those are all mlm programs or stuff in which you have to sell to your friends and family. The greatest benefit of working on the net is that I am always home with the little kids, I save a lot of money. Here’s the proper way to start

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