Tuesday, May 18, 2010

Focus Stacking

Macro photography has one main problem: Depth of Field (DOF).
At the close focusing distances used for macro photography, with magnifications around 1:1 or more, even small apertures like f/16 or f/22 will result in a DOF of just a few millimeters, or even less than 1 millimeter! Clearly, not good news if you wish to
get a full object in focus...

Here's a good example of this. Take a look at this shot of a minute shriveled leaf of a Christmas Plant (known as Poinsettia, or Euphorbia pulcherrima):



Clearly, only the tip at the front of the leaf is in focus, even though this was shot at f/16 (using a 50mm f/1.4 AI-S with a Macro Bellows and Focusing Rail).

The solution for this problem is only possible in Post Processing, and is called Focus Stacking.
It is a simple procedure in Photoshop, and I'll take you through the steps.

1) I have shot 10 photos of the leaf. It is absolutely necessary to use a sturdy tripod, to keep the framing constant between shots. It will make your life easier down the road.
I started focusing at the very tip, and then moved the Focusing Rail just a fraction of a millimeter between each shot.
You can see the full set below, and the leaf on top of the 50mm f/1.4 AI-S to give you a sense of scale.



2) Load them all into Photoshop (CS4 in this case), and add them all as separate layers in a new file. It helps the tool if you order the layers in the same sequence as you shot them.

3) You'll need to align the photos, which is done easily by selecting all layers, and using Edit->Auto-Align Layers. Use the "Reposition Only" option.

4) Now it is time to do the magic. Again select all layers, use the Edit->Auto-Blend Layers command, and select the "Stack Images" and "Seamless Tones and Colors" options.
Photoshop will create a mask in each layer, to use only the in-focus parts of each one, creating a final image that will be a blend of them all.
Here's the end result:



This is, of course, just a quick and dirty example, and I even didn't cover the entire depth of the leaf.
More shots with intermediate focus steps will help you creating an even sharper final image.

4 comments:

  1. Both (so far...) articles were thorough, meticulous and informative, as was to be expected from you. Congratulations!
    Cheers, abraço,
    PMR

    ReplyDelete
  2. Wow, I didn't know Photoshop could do that!

    ReplyDelete
  3. Very good tip! Thank you for that!

    Ou, já que falamos o mesmo idioma, muito obrigado pela dica.
    Saudações do Brasil!
    Abraço

    ReplyDelete