There are times when you can get everything in focus that you want, especially when shooting macro, you can’t get the depth of field that you want. Photoshop to the rescue.
Make a set of photos focusing on different areas within the scene.
Bring your images into your computer. It is easiest if you put all your images to be stacked in a separate folder.
In Photoshop on the “File” menu, go to “Automate” and then choose “Photomerge.” This opens your images in the same Photoshop document.
When the Photomerge options pop up, point it to the folder where the images are stored. Leave the option on the left set to “Auto” and then uncheck the option to blend images together. After pressing OK, Photoshop will go to work aligning and putting the images into the same document.
This might take Photoshop a few minutes, but when it completes, you should have a new document that has all of the images open in the layers palette. There’s just one more step to get your images focus stacked.
On the layers palette, select all of the layers. You can click on the top layer, hold down the shift key and then click on the bottom layer to select them all. Once all the layers are selected, go to the “Edit” menu and choose “Auto Blend Layers.”
On the Auto Blend Layers menu choose “Stack Images.” Press OK and Photoshop will work do the focus stacking. After Photoshop completes its work, you can see the results both in the form of the final image and the layers palette on the right side of Photoshop. You’ll see that the masks have automatically aligned and that Photoshop intelligently sampled which layers to mask into the final image.