In a previous post I introduced you to the idea of focus stacking and how it can be used with macro photography. Now I’d like to explain the method for achieving focus stacking in Photoshop. As always, there will be several different ways to carry out focus stacking in Photoshop but the method described here is the one I used. This tutorial will assume that you have already taken your series of images as described in the article Introduction to Focus Stacking.
I imported all my images into Lightroom. From here it is an easy task to export them all into Photoshop at once. Highlight all the images you want to use for the focus stack in Photoshop and click the right mouse button anywhere on one of the images while you are in either the Library or Develop module. This will bring up a menu from which you select Edit In > and then select Open as Layers in Photoshop.
Note: you can get to this same menu by selecting Photo from the top menu then Edit In > Open as Layers in Photoshop.
Photoshop will launch and all the images will be imported and placed onto their own layer within the composition. Depending on the size of each image, the number of images and the speed of your computer, this process may take a couple of minutes to complete. While they are being imported, you will see the layers begin to stack up on Layers’ pallet. When all the layers have been imported, the bottom layer (Load Layers) will be removed from the composition by Photoshop.
Now select all the layers by clicking on the top one and, while holding down the shift key, click the bottom one. With all the layers selected, go to the Edit menu and select Auto-Align Layers… from the drop down menu. This step is necessary because as each photograph was shot with a different focal length, the scene zooms slightly causing each image to be in a slightly different place in the frame. If you have taken a set of images using the focus stacking technique outlined in the Introduction to Focus Stacking article, you may have noticed this slight shift. Using the Auto-Align Layers function in Photoshop will ensure that this shift is corrected and all the layers align perfectly, one on top of the other.
Choose Auto from the list of options presented by the dialogue box, then select OK to start the Auto-Align process.
Again this process may take a couple of minutes since Photoshop has to examine each layer on a pixel-by-pixel basis and compare that layer with the adjacent layers. When you consider the millions of pixels being examined during this task, it’s a miracle Photoshop does it in such a short time.
Once Photoshop completes the Auto-Align process, you will need to crop off the edges of the image. The edges will contain pixels that could not be aligned properly because of the slight zooming effect caused by the focus shifting between shots and they will need to be removed from the final photograph. One tip to avoid being forced into removing too much information, is to compose your original shots wide with empty space around the edges.
Select the Crop tool and pick whichever aspect ratio you desire for your final photograph. In my case, I left it on original 3×2 ratio.
When you are happy with your crop, click on the accept icon on the top tool bar.
Now we will perform the focus stacking part of the process. Ensure you still have all the layers selected (Photoshop will only stack the selected layers), click on the Edit menu and this time select Auto-Blend Layers… from the drop down menu. Then select Stack Images and check the Seamless Tones and Colors check box before clicking on OK to begin the focus stacking process. Again this may take a couple of minutes to complete.
You now have a photograph which has sharp focus throughout. Photoshop has achieved this by analysing each layer and applying a Layer Mask to each. This Layer Mask allows a portion of each layer to come through and be visible in the final composition. The complexity of each mask can be seen in the Layers’ Pallet and this explains why it takes Photoshop a minute or two to complete the stacking process.
However, all these layers and masks has resulted in a huge file size and it is advisable to flatten the image before saving it into a format that will be appropriate to your intended use.
Performing focus stacking in Photoshop is a very easy task and the results can be rewarding. To ensure you have a truly sharp image, from to back, it is worthwhile taking your time to set up properly and only move the focus by small amounts between each image. Experiment with this technique and let us know how you get on. If you wish to send in some examples, we will post them into your own gallery for you.