The limitations of depth of field experienced by macro photographers are, in optical terms, an absolute barrier. It is just not possible to design a lens which gives a large reproduction ratio at a practical working distance from a small subject together with extensive depth of field. Apertures of about f/64 are the current practical minimum achievable, and even at this setting the depth of field can be very shallow.
The digital age has nevertheless made possible new approaches to image manipulation, and among these is the fascinating concept of focus stacking. The principle involved is very simple. A subject is set up and photographed with normal macro equipment, but the focus is not optimized for maximum depth of field in a single shot. A series of virtually identical images is created using small step changes in the focus distance. For instance, a photographer might first focus on the closest part of the subject, perhaps an insect, and then shift the focus progressively across the creature's body in tiny increments until the furthest extent of its body is captured absolutely sharp. The focus increments must be calculated to provide a sharply rendered image of every part of the subject.
The images accumulated in this way are then "stacked" electronically and accurately aligned on a computer. Specialist focus-stacking software is then used to merge those areas of each image which are sharp. Any number of images can be put in to such a stack.
One example of focus-stacking software, Helicon Focus, selectively combines numerous identical images using the sharply focused areas of each. Images are also aligned and adjusted in brightness and size to compensate for changes of lighting and magnification that occur between shots.
The images produced by this electronic merging process exhibit depth of field extending far beyond that which can be achieved with any lens.