Multi image stacked macros

This article originally appeared in the Royal Photographic Society Journal.    

It has largely been rewritten to include a lot of current information and details on stacking hardware and software. 

The new close up and macro world of stacked image photography.

There as been a recent transformation in close up and macro photography which has been stimulated by new software used in the microscope world.  This is the new digital phenomenon of multi stacked images that has revolutionised both the image quality and the depth of field of close up and macro pictures. Let us first look however at the position of present techniques.

Problems of close up photography

The closer the camera is to the object being photographed, the less is the depth of field in sharp focus (DOF). It makes no difference whether the magnification is achieved with dedicated macro lenses, additional close up accessory lenses, tubes or bellows, there will always be a reduction of DOF. To combat this, conventional photography has used the optical feature of all camera lenses by reducing the aperture size which will then  increase the DOF. A reduction to say f22 or smaller will considerably increase the depth of sharp focus. This is almost always necessary when working into the macro range, beyond the one to one magnification ratio.

However, the best quality images are actually those taken with the lens open to around f8. Apertures smaller than this begin to show a diminishing quality due to a phenomenon called diffraction. By f16 and certainly by f22 you are starting to turn that expensive lens into a pinhole camera, and the light passing through the aperture actually bends a small amount and the image starts to blur. This is not visible on the camera screen and barely seen on your computer monitor, but critical viewing of a large print will be disappointing. This is why you rarely see edge to edge sharp close up and macro pictures any larger than A4 size in a book or as an exhibition print.

Just taking a distant photograph of a flower and cropping the image to select just a small fraction of the whole will just result in image degradation and eventually pixellation and a very inadequate picture.

Of course not every picture needs to be sharp from edge to edge, and many beautiful creative images are made in which the blurred part of the picture leads the eye into the important sharp part, often the picture centre. There is a Japanese word ‘bokeh’ used in this context which means the mathematical gradient of blurred to sharp parts of an image. However we are here discussing overall sharpness of the highest quality in more scientifically accurate photographs.

Correcting the blurred image.

This new answer is not to not make the aperture smaller, but to instead keep to the optimum of say f8 and to in some way manipulate or enhance this image parameter.  Merging multiple images together has become a commonplace working method in astronomy, but this has mainly been to blend very faint pictures of distant galaxies. The Hubble space telescope for instance is able to merge some three hundred indistinct images to create one final sharp picture.

Our interest is similar, but somewhat different in that we need to merge pictures that have some sharp parts, and some blurred parts into a final overall sharp photograph. This has been largely solved by multiple image sequences in microscopy, and this method is now available for our close up and macro photography. Dedicated software is used to achieve the image stacking and merging.

The basic technique is to take a number of photographs, moving the camera or its focus a small fractional amount between each image to create a ‘stack’ of pictures. This is of course not totally dissimilar to medical CT scanner imaging. Here however all the images are merged together to produce an aggregate depth of field for a single final picture. The command sequences programmed into the computer are called algorithms.  For simplification it is easiest to explain the three parts of the algorithmic processes used in this software,although in practice they work simultaneously. First of all each image is processed so that the sharp parts are kept and the blurred out of focus parts are discarded. Secondly these sharp parts are merged together to form not a stack but a single all sharp picture. Thirdly a correction takes place during the merging to remap the picture as it is being processed. This is because the lens or camera movements actually create a small parallax optical distortion which shifts the image position very slightly on the sensor. The remapping sequence repositions the pixel coordinates to correct this error.

The result can be a composite photograph with a depth of field impossible to obtain by any other means, and with an outstanding image resolution.

Users of Photoshop CS4 will already be familiar with a stacking sequence which is available within that programme. However there are now a number of dedicated computer programmes available for this work. These have sophisticated adjustments to obtain an optimum result, and will be discussed later.

Achieving a stack

There are four basic mechanical methods now in use to take the photographs. These are:

1Keeping the camera body still and moving the camera lens focus manually.

2Keeping the camera body still and moving the camera lens focusing motor by controlling software. This is only suitable for selected modern cameras and lenses

3Moving the whole camera mounted on a hand controlled mechanical movement stage.  This mechanism has a screw thread incorporated in it to allow accurate shifts.

4Moving the whole camera by mounting it on a stepper motor base.

It becomes obvious that to start with the camera must be mounted on a very firm base. Simple stacking can be carried out with a tripod, but more sophisticated work will need a specially made stable support to prevent any movement at all during the image sequence. It will be mounted on rubber supports to minimize any vibration.

The ideal is what is called an optical bench. Magnificent steel benches have been made by optical firms for lens testing etc. but here we are considering a simpler design perhaps made from an old photographic enlarging stand or a DIY effort. A similar firm support must also be made for the object to be photographed. Lighting also has to be extremely even between the multiple exposures because the algorithms discussed above fail to work properly if the illumination varies between the frames. In practice for flower photography flash is usually the most reliable method of lighting. Tungsten lighting produces too much heat and therefore consequent rapid wilting and movement, and natural lighting is rarely consistent during these long procedures. LED lighting is a cooler artificial source and may well become the illumination of choice in the future.

Calculating the number of images required.

A useful start to this is to find a depth of field table perhaps in your lens manual, in a reference book or the internet. The variables we are concerned with are the f number and the ratio of the size of the object we are photographing ( ie. the field width) to the size of the camera sensor. This ratio is called the reproduction ratio or magnification ratio. The depth of field means the distance between the nearest and furthest parts of the scene which appear acceptably sharp.

It is surprising to find out that for this purpose, the amount of DOF is actually very nearly an optical constant for all normal close up and macro lenses, whatever their focal length. For an example an object 36 mm across filling the frame photographed by a camera with a 36 mm wide sensor will result in a 1:1 ratio. At f4 the DOF will be 0.48  mm from front to back, at f8 it will be  0.96 mm and at f32 it will be 3.8   mm.  The depth of field may alter very slightly with different lenses, because of the multiple glass construction, helical focusing mechanics and methods of optical measurement ( circle of confusion physics etc.) but for all practical purposes the DOF of a 200 mm macro lens will be the same as a 60 mm macro lens . PROVIDED THE MAGNIFICATION RATIO IS CONSTANT AND THE APERTURE IS THE SAME.  For our work here the most important lens choice is to have one which gives a comfortable working length. I have found a 105 mm lens is a happy compromise for flower photography, and this means that there is a workspace room for flashguns between lens and object.

Because TTL flash is used then one can use our optically optimum f8 aperture as above and control the exposure with the flash output. Hence we now have a DOF of 0.96 mm as above for our 1:1 size ratio of magnification

( Note that if other specialist lenses or microscope objectives are used, then they may have their own fixed aperture. And also the DOF will change appropriately with a smaller or larger size sensor)

If we are photographing a postage stamp or perhaps a coin then the depth of field of 0.96 mm at f8 will probably be adequate. If however we are attempting an insect or perhaps a flower then 0.96 mm will frequently only give us a very small part of that in sharp focus.  We are now concerned with increasing the DOF by using our new stacking system. To cover a flower which is for example 20 mm deep at our 1:1 magnification we will need 20 divided by our DOF figure of 0.96. This comes to 20.8 (ie 21)   pictures needed in our stack. In practice we need an overlap between the images and at least 25% more would be a suggested number, making a total of say 26  pictures. In practice around 30 would be taken.

This figure changes sharply if we start to attempt greater macro close ups. For instance at a 3:1 magnification (this means a 12 mm object filling our 36 mm sensor) the DOF at f8 is a very limiting  0.21mm. The centre of a small flower is frequently less than 12 mm across, and the same in depth.

We now need 12 divided by 0.21 to calculate the number of pictures need in the stack. This means 57 images plus a 25% overlap plus a few extra end pictures, and we are into a 76 picture sequence. This is not at all impossible, but it becomes a challenging task to obtain this number keeping an absolutely constant exposure and a completely smooth movement and vibration free sequence.

This means that the total number of images in our stack will rapidly increase and stacks of over this number of images are frequent for smaller flowers. A smaller sensor size will of course reduce the number of pictures required because it changes the magnification ratio calculation.

First of all taking the photographs.

After calculating the number of pictures required the camera is set up to move from front to back or vice versa. It has to accurately cover the near and far parts of the object required for the final photograph. Care must be taken that the framing does not ‘walk out’ of that scene during the photographic sequence. If the camera is tethered to a laptop ( usually via. USB cable then the photographic sequences and other data can be viewed on the larger screen.    

Method 1Moving the camera lens focus on the camera.

Keeping the camera still and moving the focus of a lens a fraction between pictures is an ideal easy way to achieve a sequence of stacked images. This technique can be an ideal way to experiment with stacking at minimal cost and is adequate for pictures in close up ranges, but smaller than this, into the macro range, the manual fine tuning of lens focussing becomes almost impossible to achieve.

However all you need is a firm tripod to mount your camera and whatever method of close up adjunct you are using - perhaps a close up lens or an extension ring. What is difficult is to avoid moving the camera assembly during the capture sequence. A fractional lateral knock will ruin the accuracy of the procedure.

Method 2  Computer Control  of the lens focussing.

This is a new method of stacking photography and  can be found as an add-on to Helicon Focus software. This enables the camera lens focussing mechanism to be activated from a laptop computer so that multiple successional images can be taken at increasing focus depths into the object. For Nikon cameras there is a windows only software programme called ’Control my Nikon’ at a very moderate cost which also does this.

There is however a downside to these focussing control systems. This is because they only work in the ‘Live View’ mode of the camera meaning that a mains adaptor may be necessary because the battery can become exhausted. An even more important factor is that the camera can start to overheat after fifteen minutes or so, and it automatically switches off to cool down. This is not a working possibility with many stacking procedures which can quite easily take twice this time.

Method 3   Mechanical control of camera movement using a hand operated screw thread assembly.

This has been a favoured technique for producing stacked images. The movement is of the whole camera assembly; that is to say camera plus lens including tubes, bellows and flash. They are moved together on a supporting rail system by a screw thread running through the rail assembly. The Manfrotto  454  micro positioning plate  is an example of such an apparatus . There is also rail made by Novoflex.

Handmade shift apparatus can be made from old enlarger columns, but the very small accurate movements needed for higher magnifications are rarely possible without a lead screw shift system.

Method 4   Computer controlled motorised camera shifts.

This means that the whole camera assembly is moved as above, not just by a hand operates screw thread, but by a small stepper motor which is computer controlled. This a recent innovation by the American Cognysis company and is called ‘Stackshot’

Highly accurate shifts of as little as 0.01 mm are possible with the camera assembly driven by a lead screw joined to a precision macro rail support. There is even a programmable ‘settle time’ that can make a fixed delay after each motor movement so that any vibration of the motor will come to a halt!

The Stackshot has its own computer control, but another advance has come from the ‘Zerene Stacker’ software company. They have enabled their software on a laptop to both control the servo motor and view the image sequence as they are taken.

Photographic technique

The essential first step is to have a firm base for the photographic sequence.

The author has constructed for himself a DIY optical bench using a substantial oak board as a base. This is mounted on rubber strips to reduce vibration from external sources. The apparatus has been modified several times, and is under constant revision.

Lighting is nearly always a ring flash system. The author uses the  Nikon SB-R200 lights which are are held in a supporting ring around the lens and controlled by the SU-800 commander unit. A 105 macro lens is preferred over a shorter focal length because this allows a convenient working space for the flashes to be arranged between lens and object. The main flash illumination should be physically attached to the camera or lens mount, and hence moves with the assembly. If the lighting is fixed and does not move, then the angle of the illumination will change with the camera shift and the illumination fluctuation can cause image artefacts.  Another reason for choosing the correct lens is that longer focal length lenses, especially used with extended bellows often mean that the flower is so far away from the camera that the actual set up becomes quite difficult. The lens is reversed when higher magnifications are used. Short bursts of ‘Live View’ on a tethered laptop help in setting up the flower so that the screen image can be accurately viewed

The flower support framework should be at the far end, but sitting on the same optical bench as the camera. It must be absolutely rigid yet easily movable to shift the flower into new positions. The author is using a miniature form of laboratory scaffolding called ’Climpex’ but is not sure if this is still available. The actual mounting of the flower on the scaffolding has been modified to a simple method of using about an inch of plastic drinking straw tubing. The flower stem is wrapped in a small piece of damp paper tissue, and pushed down the tube. It is therefore kept moist which delays wilting and the plastic is substantial enough to be firmly held by the small crocodile clip on the Climpex stand.

The background can be black, but my personal preference is to use an actual photograph printed on matt paper to replicate the background that the flower comes from. I have a collection of A4 backgrounds of foliage, grasses and skies all purposely printed blurred and out of focus for this purpose!

The flashguns need to be carefully monitored to ensure that they fully recharge after every individual photograph. This means that the operator has to watch the LED warning lights on each gun to make sure they signal that the capacitor is fully ‘soaked’ before taking the next picture. A further check if the camera is connected to a laptop is to carefully watch the histogram readout as the picture is taken. Any jump of the pattern is likely to indicate a failed exposure. If this happens then a further image is taken or else the sequence is abandoned and a new start is made. Extra spare batteries should be  to hand  for the flash units when they need replacing. A notebook is another necessity to keep a record of all the adjustments made in a constantly changing  method sequence.

These photographs have to be taken in near studio conditions. This means a solid table or bench, no floor vibration, no open windows or vibrating machinery and a general low even light level, preferably of natural light. There are likely to be a number of test exposures made before a satisfactory smooth sequence is finally produced. Also once the set up and image set appears to be alright it is well worth while taking several more stacks at different angles and step distances. It is surprising how often a small movement of a petal or other flower part can occur, and is not noticed until the final stacking sequence is produced.

Once again it is worth stressing that when setting up your flower don’t frame too tightly because the far end of the sequence may ‘walk out’ of your original early frames. There can be very small changes of magnification and perspective between the first and last frames and it is easy to forget this and end up with a critical petal edge missing on the last frame. The secret is to not frame tightly and to take a few extra pictures at both the beginning and the end of the sequence.

Notes on software applicable to these procedures

(Please note that these software programmes are constantly being updated and changed. These notes were made in August 2011 and are hopefully correct at that time)

Camera control Pro 2 for Nikon cameras. (Windows and Mac)

Used on a tethered laptop this will trigger the camera via a USB cable and will enable an immediate image to be seen on the screen. In addition a histogram can be shown which greatly aids the control of en even sequence of exposures. Focus control only in ’live view’mode.

Control my Nikon (Windows only)

Inexpensive control software which works as above on a tethered laptop but is for Windows only. Free trial period of use. Will also download to Zerene stacker

Stackshot software  works with the Stackshot  servo motor using its own computer  control box. Superior control of motor with ‘ settle’ time  programmable after each exposure reducing the vibration of the apparatus during a photographic sequence. This can be set to work completely automatically. However the author has found that then there can then be little time for a visual check on the flash battery status. The author uses manual control so that this can be monitored together with the read out histogram.

Combine ZP   A cost free stacking software in the open source software regime. The author has found this rather difficult to use, but more computer orientated users will undoubtedly be happy to use this free programme.

Helicon Focus .This is one of the original stacking software programmes. It has a 30 day free download offer.  Several versions include the more expensive professional version  which will control a camera focus (via a USB cable)  remotely  using ‘live view.’

Zerene Stacker

A newer Windows and Mac Programme which includes a 64 bit version.

There is also a 30 day free trial version. Another feature is a direct interface with the Stackshot hardware.

(Note: both Helicon and Zerene have some quite sophisticated control of the actual stacking procedure . These software controls can alter

the ‘radius’ ie. the size of the area around each pixel point which determines if the  pixel is totally focussed. Also the ‘smoothing’ which determines how the focus areas are combined.

Details on these settings and other parameters are incorporated into the individual programmes, and are beyond this short report.

DIY enthusiasts interested in building their own apparatus may be interested in the stepper motors and control mechanisms sold by Phidgets inc. in the USA and Trinamic Motor Controls GMBH in Germany.

John McCormack

Dr John McCormack ARPS is a former Dental Surgeon now dedicated to plant and garden photography. He may be contacted on:

Also see the article on the new Stackshot hardware - an innovative improvement to stacking procedures
Click here to return to stacked macro imagesStacked_macros.html
Click here to return to home pageHome.html

Camera set up

Click  here to return to macro imagesStacked_macros.html
Click here to return to home pageHome.html
Click here to go to the Stackshot pageStackshot.html