Photography / Tips and Solutions

Photo-Editing Tutorial: Macro Photography With Focus Stacking


Physics always seems to get in the way of photography. The physics here refers to the fact that when photographers get closer to a subject, the depth of field gets shallower and shallower. Unfortunately, if you need more depth of field, stopping down can’t always get you where you want to be, especially when diffraction can compromise on image quality at extremely small apertures. Focus stacking can really save the day, allowing photographers to create images with everything they need being tack sharp. And, thanks to modern image editing software like Adobe Lightroom 6 and Photoshop CC, it hasn’t been easier.

So how do you do it?


First things first: you are going to need a camera and a tripod, and the sturdier the tripod, the better. Any changes can make blending and aligning these images much more difficult. Once you have your subject set up you are going to want your camera in all-manual mode, since any fluctuations here can be a pain for you later. This means manual ISO, aperture, and shutter speed, as well as manually controlled focus.

Choosing your aperture is likely going to be the most important here because it determines how many images you will need to take and the overall quality of the resulting picture. I generally aim for my lens’s sweet spot for sharpness and work from there but, if you want to take a few photos as possible, a smaller aperture may be best.

Once all of that is worked out, the process is fairly simple. Working from front-to-back (or vice versa) you take an image where you want the plane of focus to start and keep moving back until you reach where you want the focus to end. This can take as little as three shots or even up to the hundreds, depending on how precise you need the final product to be and how shallow your depth of field is during shooting.

Now that you have the raw files, it is time for the fun.


I am running Adobe Photoshop CS6, but the CC versions of the software operate in almost the exact same manner, so you should have no problem following along.

Step 1: Using either Bridge/Camera Raw (my method) or Lightroom, find all of the raw images you will use to create the final photograph. Once you have them, you should make your raw edits to exposure, shadows, highlights, etc. The main thing to watch out for here is that everything remains the same for each image; otherwise, the later blending steps could have issues.


Step 2: Now that you have all of your images in Bridge or Lightroom and they are ready for Photoshop, you should use a fun trick to pull them 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 super-simple tools to get the effect we are after. First, use Photoshop’s Auto-Align Layers tool to make sure everything is clean. Then, use the Auto-Blend Layers tool right after.


Step 4: Almost like magic, you should have a pretty spectacular image to work from right now. It is possible that certain layers don’t quite blend correctly on occasion and require manual masking/erasing but, for the most part, you should have a very workable image.


Step 5: Make your final edits and adjustments at this point, working as you normally would. Make sure any issues in the unimportant areas of the image are cleaned up.


As long as you are careful and organized, this should be a very simple and easy trick to use in your photography. It may not be needed all the time, but having this in your back pocket can help you save a difficult shot without compromising on image quality.


Share your best Macro Photographs with us on Twitter or Instagram with the hashtag #MacroPhotoWeek for a chance to win a new macro lens and other prizes.

Sweepstakes rules and regulations can be viewed here.


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 :)

Even better with Zerene Stacker

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....

This is neat

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: