Sunday, February 5, 2012

Focus Stacking



When I am really close to a subject, depth of field is usually an issue.  Under normal circumstances I need to make a choice as to what I need to have in focus. It has become customary to use this characteristic in a creative fashion - you will see images that have only a small portion in crisp focus, with the rest blurred. Back in the day if I wanted a subject in complete focus from front to back I could always use my Sinar F View Camera with it's tilting lens/film planes to increase depth of field, similar in function to the one below.

http://commons.wikimedia.org/wiki/User:Jacopo188

Nowadays I often use a technique that combines a series of images - or slices - of the subject, each one taken at a different point of focus, from front to back. Then I combine them in post processing to produce an image that is entirely razor sharp - with seemingly unlimited depth of field. This is known as Focus Stacking.

There are several third party applications that do this - CombineZP, Picolay, Tufuse (all free), Helicon Focus, Zerene Stacker, and Photoshop CS4 and CS5 - all commercial applications, some offering free trials.

I will go through a quick illustration in Photoshop CS5 to show how I did the Day Lily above.

When photographing a subject that you intend to apply focus stacking to, ideally you should be on a sturdy tripod, equipped with a horizontal arm that can get you close to subject, like this one from http://store.tabletopstudio-store.com/hoarmfortr.html



and use a rack and pinion macro focusing rail to allow you to precisely adjust the distance between the subject and the camera like this exquisitely crafted one from fellow photographer and master machinist Kyrstof Hejnar, which can be found at http://www.hejnarphotostore.com/:






It is possible to obtain reasonable results by simply adjusting the focus, but this approach does have it's downside. When you change focus, you change the optics, and as a result you may end up changing the out of focus background's (Bokeh) character. The perspective changes, and the magnification changes, since you are extending the lens to subject distance - those elements that are further away from the camera will diminish in size. Also, most modern lenses feature internal focus which adjusts the optical formula to change effective focal length to get you in closer without altering the external parts of the lens. As you close in, the lens will shorten the focal length.This will also affect image magnification. Moving the camera to change focus point eliminates all of this since the camera to subject's focus point never changes - subjects will be rendered more accurately. Luckily, adjustments for the variances in subject size/magnification are within the capabilities of the focus stacking applications, and some correct better than others.

Shoot the images in RAW format. If you are not familiar with RAW format, look at my earlier post on the subject and make use of all of the helpful information that is all over the Internet. Shooting RAW allows me to adjust a single image for balance, lighting, contrast, lens aberrations and distortions, white/black balance, sharpening, etc - and apply the adjustment made on the one image to the rest of the images - a real time saver.

I start by setting up my camera for the lowest ISO, my lens for its sharpest aperture and greatest depth of field, and since I am using a tripod, just allow the shutter speed to fall where it needs to be to give me a proper exposure - which in this particular case was ISO 200, F8 and 1/500 sec. I use aperture priority to let the camera determine the correct shutter speed, make a mental note, set the camera to manual exposure using the cameras suggestion, and turn off auto focus. Next I manually focus on the nearest point that I want to see sharp and take a shot. I advance the focus a little to the rear, making sure that I overlap the previous shot's focus. I take another shot. I continue to repeat this until I get just beyond the farthest area I want in focus.

When I get back to my computer I copy the contents of the memory card to my computer, open up Adobe Bridge and identify the images I want to stack. I hold the shift key as I highlight the images. When I have finished my selection, I right click inside any one of them, and right click and select Open in Camera Raw in the fly out menu.


All the images will be opened as a set in Adobe Camera Raw. After looking one of the images and making my adjustments, press Select All at the top left of the screen, then Synchronize, to apply any adjustments made to the entire set. I Press Ok in the next screen to apply changes. With all the images still selected, I press the Open Images button at the bottom to bring them into Photoshop.



All of the images are brought in as individual files. With the next step I combine all the images in one file as layers.



The Files-Photomerge command brings up the dialogue below, where you select Auto Layout, and Add Open Files, with no other boxes checked. If the Blend Images Together box is checked, uncheck it. Pressing OK will create the layers.



I highlight all the layers, then execute Edit-Autoblend Layers;



in the next dialogue, I pick Stack Images and check off Seamless Tones and Colors.




After a few seconds (longer if you are merging lots of layers) the final product emerges. I remove the contributing images without saving them, then I flatten the layers using Layers-Flatten Image.




I then apply the usual sharpening cropping and other adjustments just as if it were an ordinary single image.




Focus Stacking is a very useful technique that I use when shooting in close quarters, but it can be equally useful with larger static subjects over longer distances - like a large ship, freight train, landscapes, etc. It produces images that would otherwise be impossible, and as you can see, not very hard to accomplish. See you soon!





1 comment:

  1. I really like how your easy to follow instructions & screenshots are not only helpful, but actually make this process less intimidating. I look forward to creating my first focus stack. I'll be sure to let you know how it turns out. Great post.

    ReplyDelete