Focus Stacking

Focus Stacking

As defined by Wikipedia…Focus stacking (or hyperfocus) is a digital image processing technique which combines multiple images taken at different focus distances to give a resulting image with a greater depth of field (DOF) than any of the individual source images. Focus stacking can be used in any situation where individual images have a very shallow depth of field; macro photography and optical microscopy are two typical examples.

Macro or micro photography, has focus limitations due to the nature of the design of the lens. You can capture incredible close up details but the depth of field (distance between the closest and furthest objects in a scene) is extremely limited.  The range of focus is directly related to the degree of “macro”.  The end result is an image that has a very small area where the image is sharp; ahead and behind of this focus point the image is unsharp.

Using the Focus Stacking technique has allowed us to overcome this “narrow band” of focus and gain infinite focus between the “near and far” objects within the scene.


The starting point for focus stacking is a series of images captured at different focal depths; in each image different areas of the scene will be in focus. While none of these images has the scene entirely in focus they collectively contain all the data required to generate an image which has all parts of the scene in-focus. In-focus regions of each image may be detected automatically, for example via edge detection or Fourier analysis, or selected manually. The in-focus patches are then blended together to generate the final image


For this particular object we took seventy one (71) photos to “focus stack” as one final image…the trio images above represent the furthest, mid and closest range of the pictures taken.

The upper left photos represents the furthest focal point whereas the one in the lower right is where the focus is at the forefront of the object.

MicroFocusRailThe Micro Focus Rail is the key to taking a range of photos where you can control the small increments necessary to travel from the closest to the furthest focus point of the object.
After the Tripod/Focus Rail/Camera/Lens is setup we turn off most of the camera’s auto functions (focus, exposure etc.) and manually focus on the further distance of the object we wish to include in our focus-stack.

Then you take a deep breath and commence on the task of taking a series of photos where the camera/focus settings are never altered; rather between each exposure you adjust the micro focus rail “one increment at a time” as you move from the furthest point to the closest point.

Depending on the type of focus rail you are using the increments can be manually adjusted or automatically controlled using a motorized controller.

The Software

Prior to the computer focus stacking was not possible as the small/fine increments taken within the camera need to be compiled into one master image.  This is not technically possible without the aid of the computer as millions of computations are made to assess each image, extract the “sharp in-focus” band and then create a new image with “just” the sharp sections from each of the 71 images.

We use Zerene Stacker to “stack” our images into one final image.  Zerene Stacker uses two methods to determine which portion of each image is in-focus.

  • PMax is a “pyramid” method. It is very good at finding and preserving detail even in low contrast or slightly blurred areas. It’s also very good at handling overlapping structures like mats of hair and crisscrossing bristles, nicely avoiding the loss-of-detail halos typical of other stacking programs. But PMax tends to increase noise and contrast, and it can alter colors somewhat.
  • DMap is a “depth map” method. It does a better job keeping the original smoothness and colors, but it’s not as good at finding and preserving detail.

Once you have determine the best method the software does the rest..

Still life of cactus skelton

If you wish to discuss this technique in further detail please feel free to contact us


Leave a Reply

Your email address will not be published. Required fields are marked *