Even when shooting at f/16, not every part of the photo will be in focus. Depending on where you focus is at, there will still be some fall off. What if you wanted to get your entire photo in focus? You can merge multiple exposures where the focus point has been changed to get one photo showing everything in focus. Landscape Photographer Mark Denney shows us how easy it is to merge multiple exposures into one image using Lightroom and Photoshop together. If you do not use Lightroom, you can still achieve the same results only using Photoshop, so don't worry.
After you have processed one image, copy the settings to the other photos so they are all matching. The rest is pretty much automated and relies on Photoshop's calculations on the photos to do its magic. Before merging the photos, it’s good to make sure they are all still aligned, which they shouldn't be too bad in alignment if you were using a sturdy tripod, by using the Auto-Align Layers setting under the Edit menu. Once all the layers are aligned, just use Auto-Blend Layers under the same menu, use Stack Images and voilà you are done!
Photoshop does a pretty amazing job with its calculations and merging the photos together, but if you wanted you could review and edit the mask if you feel any areas could be better. Most of the work will be doing actually shooting and making sure you get the focus where you need it. Denney recommends shooting in manual focus and focusing at different distances, but it can be done under automatic focus by changing your focus points distance. Just make sure to check the camera steady and don't move it too much and have your photos misaligned, even though Photoshop could re-align them in post. Focus stacking isn’t only used for landscape photography nor when you what the entire photo in focus. Maybe you want the entire subject in focus with the background blurred away. What kind of projects have you used focus stack for?