Photo-Editing Tutorial: Focus Stacking for Macro Photography


As much as we like to think photography is a pure art form, we do still have to consider basic physics when we create images. One major sticking point is that when you close in on a subject, there’s something that happens all the time in macro photography: the depth of field becomes increasingly shallower. Normally, a couple of stops down on the aperture can solve this problem but, at extremely close ranges, you can’t always get exactly what you want and you must contend with issues like diffraction if you keep pushing your aperture ever more closed. This is where focus stacking can save the day, because it lets you create images with deep depth of field without many of the downsides of conventional shooting. Thanks to modern cameras and image-editing software, it hasn’t been easier.

So how do you do it?


The process of focus stacking starts during shooting. If you mess up here it can make things a lot more difficult, if not impossible, later. It isn’t that problematic, however, because the essential equipment is still just a camera and a tripod—make it an extra sturdy tripod, if possible. From here on you will want to set up your shot as normal, since the actual focus stacking process doesn’t begin until you are ready to hit the shutter.

Let’s go over some shooting tips that will help make this process as seamless as possible. First, you are going to want to be shooting in manual, because focus stacking involves taking multiple images in a row and then blending them. The closest you can get the images to match in the capture stage, the easier the editing will be. Second, manual focus is almost required, unless you are using a camera with a built-in focus-stacking function, such as the Nikon D850 I used for this article, which can be set to do all the hard parts for you by automatically shifting focus and capturing a series of images based on your parameters.

When working with your camera’s settings, generally there aren’t any huge rules, though stopping down a bit can help because it means you will be likely hitting the sweet spot of performance for your lens and have slightly deeper depth of field, which will result in smoother blurring and, potentially, a need for fewer photos.

Once all that is sorted out, the process is simple. Working from front to back, or vice versa, you take an image of where you want the plane of focus to start and keep adjusting the focus for each shot thereafter, until you reach where you want the focus to end. This can mean as few as three images or even up to hundreds, depending on how precise you need the final product to appear and how shallow your depth of field is during capture.

Now that you have the raw files, it’s time to jump into the meat of this tutorial.


There are a few pieces of software that can handle focus stacking, but here I am going to stick with one of the most common options: Adobe Photoshop CC, which is available in the Creative Cloud Photography Plan.

Step 1: Using either Bridge/Camera Raw, my preferred option, or Lightroom, find all the raw images you will use to create the final photograph. Select them all and make sure that any changes to exposure, shadows, highlights, etc. are made universally across each image. Basically, here is where you make some initial changes and ensure everything matches for easier blending later.

Step 2: With all your images now selected in Bridge or Lightroom, you are ready to go to Photoshop, and there is a fun trick that makes it super easy to pull them all in as layers in a single document. For Bridge, this is found in Tools > Photoshop > Load Files into Photoshop Layers. In Lightroom, it is under Photo > Edit In > Open as Layers in Photoshop.

Step 3: Now that the hard part is done, there are a couple of tools to get the effect we are after. First, use Photoshop’s Auto-Align Layers tools set to Auto to make sure everything is lined up. The reason for this is because things like focus breathing can result in the sequence of images not being perfectly matched. Second, you will use the Auto-Blend Layers tool with Stack Images and Seamless Tones and Color selected to create a complete image.

Step 4: Ta-da! After a short processing time, you should now have something very close to your final image. It is possible certain layers didn’t blend perfectly and some manual masking or editing may be needed, or that you need to crop out some of the edges, but you are so close to the finish line as long as you followed the earlier instructions.

Step 5: From here you can crop down to your final image and make any standard edits and adjustments you need. Then export it to whatever format you would like to share online or make a print.

Being careful and organized is critical for focus stacking and, with a little bit of practice, you should be able to add this tool to your repertoire easily. It may not be needed all the time, but for the moments it is useful it can be a real lifesaver, allowing you to create a difficult shot without compromising on image quality.

Click here to learn more about Macro Photography. Do you have any of your own tips for pulling off the perfect stack? Any questions? Please feel free to leave a comment below! 


That’s a really informative article, I am very much inspired. Your tutorial helps me as like my mentor, i am looking forward to more informative article form you. 

Thanks for reading, lutfor r., and thank you for taking the time to post your comments.

Thanks, very useful tips.  Can't wait to try it.  Now I wanna cookie. ;-)

Don't forget a nice, bracing cup of tea to wash that cookie down!

The hardest part of focus staking photography, taking the series of incrementally focused images, can be easily accomplished if you own a Nikon, Canon, or Sony camera and a smartphone, iPad, android or laptop, using the free hard-wired software, Digicam, or the more sophisticated Helicon software.The best thing about them is that you don't need to touch the camera to take the shots or adjust focus. I blend the images using Photoshop.

any tips for somebody using Luminar instead of Photoshop? maybe a software I can buy?

Hugin can focus stack. Hugin is primarily a panorama stitcher, but can also do focus stacking with the included Enfuse program. Hugin is free and works well.

I use the Helicon Software.  It's pricey if you want to own it, however, they have a try before you buy on the software.  A focusing rail is a real time saver, too!

Clear and easy to follow. It worked! Now i must practice.


Thanks for the guide. I am learning Photoshop at the moment and this will come in very useful!

Can focus stacking be accomplished in Photoshop CC. Thanks

Hi Ian,

Yes, Photoshop CC does support focus stacking in practically the exact same manner. The note for CS6 is only to clarify that earlier versions may not support it, but later CC versions will have no issues.

If you use Lightroom for image management and raw conversion, you can select the images and use Photo>Edit In>Open as layers in Photoshop.

Makes getting a set of images as layers very easy.


I've followed several tutorials, here, and from Youtube... and for some reason, I cannot get certain areas of my image to be in focus, despite there being a photo of the area I want in focus... I have all the focused frames I need, but for some reason not all of the areas I want in focus are showing up in focus.  I'm afraid I can't explain it better than that.  Maybe someone with a bit of experience can ask me some probing questions, to help me figure out what I'm not doing properly....?  

Hello J.Gibson,

Just to help, it sounds as if you have alignment issues which maybe caused by your software having a hard time recognising the photo of the area in focus as part of the master set. Photoshop is convenient but is not as good as Zerene Stacker at aligning a stack and compensating for perspective changes. Another thing that might help is smaller increments between successive photos. Have a look at my focyus stacking pages at - some more info etc there.



Thanks.  I learned something.  Not all of us are PROs.  : >

So much easier - and quicker - with Zerine Stacker!


But if you have Photoshop already, there's hardly a need to look elsewhere since it's not that hard to perform in Photoshop. Moreover, if you're on Mac OS X, I imagine you may as well create a folder action in Automator to look and process Step 3 to Photoshop once they're drop in a given folder.


Thanks to the OP for the tutorial :)

Great piece. I've been using this technique a lot on model railroad subjects. I'd put in an example if I knew how to do it here.


Ed Merrin

Just save your images on the net somewhere. Then post the address here so others can see them there. There are many free image sites you can save them on including flickr, facebook, photobucket, google+, etc.

Ed Merrin wrote:

Great piece. I've been using this technique a lot on model railroad subjects. 

I did a stack of some Revel HO farm buildings I built 50 years ago (found when cleaning my mother's garage).

This was an experiment done with a Nikon D800E, bellows, an El Nikkor enlarging lens, and a home built automated rail system. A threaded rod is turned by a stepper motor to change the distance between lens and camera body and fire each shot. It is controlled by an Arduino type circuit board that is programmed in C. Zerene Stacker was used to merge the stack. 

There are three methods for shooting images for stacks. 

1. Change the focus setting on the camera. This is best for subjects more than a few meters away, such as landscapes. It will work with closer subjects, but is not optimum for close-ups. 

2. Move the camera towards or away from the subject. This is good for close-up work. You can buy an automated rail system to do this (StackShot) for around $600. I built one for around $200 and a lot of time (which was fun). 

3. Keep the subject to lens distance constant and move the camera body (sensor) to change focus. This is optimum for macro and close-up work.


Shooting a lot of food at the moment. This is going to make my life so much easier in post production. Thanks heaps

Thanks for the Tutorial......

It is great !

Thanks! I am quite happy to have seen this blogs, thanks so much for all the great information, I will be pride to pass it onto fellow friends....

Great technics.  Thank you for sharing.

For some reason, both the Auto-Blend and Auto-Align tools are grayed out when I try to do this, so I can't use them. I used two images, processed both of them in ACR, then opened them in Photoshop CC. I've tried three different methods of opening them (once by opening them in ACR, then in Photoshop; once in Bridge, like the one in the example above; and once by opening them directly in Photoshop) and get the same result every time. What am I doing wrong?


Sounds like you might be missing Step 3: "Place each image as an individual layer within a single Photoshop document."

I do alot of tone mapping and these functions require all the images to be on separate layers in 1 PS image document. I use in CS4 Image stacking and when I have trouble, it usually means there is only a single layer in the image I am editing. Hope this helps !


I have had the same problem.  The trick seem to be to go to the layers window all the way on the right side of the screen and hold the shift key down and click on the first and last layer, to highlight them all in blue.   Then it will work.  This video is pretty good: