Focus Stacking




About: My name is Randy and I am a Community Manager in these here parts. In a previous life I had founded and run the Instructables Design Studio (RIP) @ Autodesk's Pier 9 Technology Center. I'm also the author ...

Learning how to focus stack is an important technique for every macro or micro photographer. Focus stacking is a post production method that allows you to combine many different images shot at different focal planes to make one crisp focused image. This is useful because (typically) the larger the magnification of your lens, the shallower of a focal plane you have to work with. It is unsurprising that a typical application of this technique is microphotography where it is often impossible to get all of your subject in focus at once. Using this approach, you can stitch multiple slightly blurry images together to get one crisp image.

This tutorial uses Photoshop.

Step 1: Shooting

The first step before you can focus stack your images is to shoot your images. Using an adjustable bellows setup or macro rail, take a series of photos starting with your subject slightly out of focus. Slowly and incrementally increase the focal plane until your subject comes into and, once again, just out of focus. The goal is to get as much of the subject into focus as you can.

In an ideal world you would have a motorized macro rail which increments your camera at fixed intervals. However, these cost hundreds, if not thousands, of dollars. Doing it by eye should work for most intents and purposes.

To learn more about shooting microphotography photos, check out my DLSR Microphotography instructable.

Step 2: Load the Image Sequence

The first step is to load the image sequence into Photoshop as a series of layers.

On the top app menu, navigate to File --> Scripts --> Load Files into Stack...

A new window titled "Load Layers" should open. Click on the Browse... button and locate your image sequence. Select all of the images and click open.

Finally, make sure that none of the check boxes on the bottom are selected, and click OK on the top right.

Step 3: Align the Layers

Select all of the layers from the Layers menu.

On the top app menu, navigate to Edit --> Auto-Align Layers...

When the new window opens make sure that only Auto is selected, and then click OK.

Step 4: Blend the Layers

Now is time to blend all of the layers together into one image.

On the top app menu, navigate to Edit --> Auto-Blend Layers...

When the new window opens make sure that Stack Images is selected and the checkbox on the bottom that says Seamless Tones and Colors. Finally, click OK to blend the layers together.

Step 5: Flatten the Image

The next step is to flatten all of the layers by going to Layer --> Flatten Image. This will remove the transparent background and combine the entire image stack into one image.

Step 6: Crop the Image

After aligning and blending the layers, the center of the image is typically the most in focus. Also, there is often transparent or "empty" space around the outside borders of the image due to slight inconsistencies in alignment.

Tighten in upon the center of the image by using the Crop Tool to remove any empty or excessively blurry space around the borders of the image.

Step 7: Color Correction

Once the image is cropped, it is time to color correct the image to your liking.

Typically, I only adjust the levels and the curves of the image. Sometimes I will slightly tweak the hue and saturation if I feel that it is off.

Step 8: Practice

The last step is the most important, and that is to keep practicing.

Even after doing this dozens of times, I'm hardly an expert at this process. Like any other skill, the only way to truly learn it is to keep doing it.

I wish you the best of luck, and hope you have some fun!



    • Frozen Treats Challenge

      Frozen Treats Challenge
    • Pets Challenge

      Pets Challenge
    • Backyard Contest

      Backyard Contest

    8 Discussions


    2 months ago

    DVD players have their laser on a sled, that can move the laser in small amounts. This sled be used to hold the bug or other object, with the gears manipulated to move it in small amounts forward or back.


    Tip 7 months ago on Step 1

    For really high quality results, I find I have to make the focus increment very small. On my camera there is a "focus peaking" option that highlights the areas in focus. I use this to increment the focus so that the new area in focus overlaps with the old. I have sometimes ended up with a stack of over 50 images. In order to stack these properly in Photoshop you need to divide them into subsets of about 4-5 each. Blend those, and then blend the results of those in the same way. See for example,

    1 reply

    Reply 7 months ago

    Woah. That's really nice results. Super-crisp. Thanks for sharing your tip.


    1 year ago

    Hint: Step 8 has a tiny type-o in it, should be Practice, not Practive. Might want to fix it. :)

    1 reply

    1 year ago

    IIRC some of the Olympus OMD cameras do part and/or all of this process in camera. But it good to know that there is a manual work around.


    1 year ago

    I also do stacks by area, then edit all together and get everything in focus. Is more work, and you have to be more carefull, especially with the lighting, but you can do prety amazing stuff. I got an ant in the microscope, at 450x all in focus.

    1 reply

    Reply 1 year ago

    Oh cool. 450X is fairly impressive.

    I should give that a try. There have been a few image sequences that this process has not worked well with.

    Do you have a picture of that?