Header background

Aperture, macro, & focus stacking

Does wavelet compositing beat small-aperture for 'depth of field?'

Logged in via User

Is blur ‘pro?’

Is this image ideal?

Loading...
MFT 90mm @~23.5cm (w.d. ~6cm) 1/100s f/7.1 CoC: 1.5cm DoF: ~1mm

(CC-BY-NC-ND)

iNaturalist.org

Nesorhamma sp.
MFT 90mm @~23.5cm (w.d. ~6cm) 1/100s f/7.1 CoC: 1.5cm DoF: ~1mm

We put a lot of thought into getting the right amount of background blur in photographs.

This is at first counter-intuitive. Why would we want to lose or miss information about the scene?

Reasons for blur in photographs include:
i) equipment constraints
ii) selective communication
iii) aesthetics

Some of the world’s finest photographs include substantial lens/background blur, whether for artistic reasons, or because scene and equipment leave the photographer no other choice.

Thus the art of painting scenes thru lenses.
But background blur may also at times be a flaw or limitation (if not sometimes a flex ?)

Resolving detail

Photography at ordinary ranges (~1 metre to infinity) usually has little trouble resolving what matters in the frame, regardless of equipment.

For portraits and cinema, large lenses are used with apertures ‘wide open’ (or nearly so) to produce maximal background blur, keeping attention maximally on the subject. Neutral density filters may even be used to achieve this.

Loading...
Typical subject focus with a decent lens | MFT 50mm 1/640s f/4

ajustinfocus.com

Typical subject focus with a decent lens | MFT 50mm 1/640s f/4

When it comes to ‘macro’ photography with big lenses pointed at miniature subjects, things break down.

Even at what would normally be a ‘mid-range aperture’ of ~f/7.1 (on MFT, no less) – an absolute maximum aperture for some purists – the focal plane and depth of field are incredibly thin, resulting in abstract images that lose 90+% of what we wanted to show:

Loading...
Subject focus(??) Only one eye is sharp | MFT 90mm @32cm 1/40s f/6.3 DoF: ~2mm

ajustinfocus.com

Subject focus(??) Only one eye is sharp | MFT 90mm @32cm 1/40s f/6.3 DoF: ~2mm

This strongly and inescapably affects macro and super-macro photography with standard [mirrorless] interchangeable lens cameras.

Optimal apertures

Blur occurs when light outside the focal point doesn’t converge, showing instead as blurred sections of light cones whose convergence points are elsewhere from the sensor.

This effect is pronounced it seems when imaging subjects that are relatively close to relatively long lenses.

Narrowing the aperture blocks more of these unfocused cones, but in doing so also blocks some of the light that the lens was built to collect.

In the beginner’s toolbox, a quick ‘fix’ for macro photography is to close the aperture down to a pinpoint (f/18+), relying on other settings (including flash power) to force a ‘more focused’ image onto the sensor.

Here is a comparison of blur versus aperture for a ‘macro’ subject, a ~4cm wide urchin test :

Loading...
f/6.3 (MFT): is the blur 'artsy?'

ajustinfocus.com

f/6.3 (MFT): is the blur ‘artsy?’
Loading...
f/11 (MFT): a decent compromise for macro

ajustinfocus.com

f/11 (MFT): a decent compromise for macro
Loading...
f/22 (MFT): genius! Just add strong lighting! ~8x more light (or slower shutter) was required.

ajustinfocus.com

f/22 (MFT): genius! Just add strong lighting! ~8x more light (or slower shutter) was required.

Problem solved!?
Run f/18+, and light everything with the brightness of many suns!

While this arguably can actually provide sufficient viewing quality for smaller (phone) screens and prints, there are reasons why ‘shooting’ at f/18+ is suboptimal:

Devil in the details

On closer inspection, detail is best at f/6.3, and lost at f/22 due to diffraction :

Loading...
f/6.3 ISO1000 (2.6x crop): impressive detail for this crop level on a 20MP MFT camera! (This crop represents ~3MP)

ajustinfocus.com

f/6.3 ISO1000 (2.6x crop): impressive detail for this crop level on a 20MP MFT camera! (This crop represents ~3MP)
Loading...
f/11 ISO1000 (2.6x crop): f/11 is a decent 'mid-range' compromise for macro detail with a good lens.

ajustinfocus.com

f/11 ISO1000 (2.6x crop): f/11 is a decent ‘mid-range’ compromise for macro detail with a good lens.
Loading...
f/22 ISO1000 (2.6x crop): closing the aperture down to a pinpoint is almost like using your iPhone. Fuzzy up close!

ajustinfocus.com

f/22 ISO1000 (2.6x crop): closing the aperture down to a pinpoint is almost like using your iPhone. Fuzzy up close!

This detail loss might not be noticeable to everyone viewing images (even these ones) on a small screen, particularly mobile phones. The cropped detail images here are 1999x1501, aka 3 megapixels (prior to additional/dynamic web/browser display). Some detail loss at f/22 should be apparent versus f/11 and f/6.3.

The small/deep pores of this urchin test , which are the main focal point of this image, show particularly noticeable softening at f/22, and even a bit at f/11.

This is not necessarily an acceptable sacrifice when using a high quality camera.

Our typical cropping is usually not so aggressive, if even done at all. But the cost of small apertures is clear (or rather, a loss of clarity).

Camera choice

A mobile phone screen in 2025 is somewhere near 2340x1080 (~2.5 megapixels), but nevertheless looks wonderful at 400+ ppi due to its small physical size. Some f/22 photographs may well look acceptable in that context, but there are no guarantees.

For photographs that need to be cropped, or viewed and enjoyed in larger, higher resolution formats, regularly using excessively narrow apertures could be a tragedy. It is an irrecoverable sacrifice of a majority of the fine detail that a quality camera is designed to resolve.

Economical compact point-and-shoot cameras/handphones/etc are capable of producing something very similar to high f-number images on a better camera. Even these produce some award-winning images in top competitions , such as the aforementioned TG Series and the Sony RX100 .

In addition, smaller lenses and sensors work with tighter cones of light for their focal properties, granting deeper depth of field for equivalent aperture values. This is one advantageous characteristic of MFT cameras versus full-frame ones, when supermacro really challenges the depth of field.

But going small doesn’t always solve the problem.

How to macro?

So what should we do about the narrow depth of field problem for macro and ‘super-macro’ photography?

One answer is image focus stacking , the modern availability of which is owed in part to the field of biological microscopy and medical imaging, as well as astronomy.

The OM System cameras have an onboard focus stacking function, but it processes annoyingly slowly for more than ~5 frames, and will often ‘fail,’ or omit usable frames.

I prefer to use the focus bracketing function, which suffers no frame limits or onboard processing delays, and doesn’t consume any battery power trying to produce an onboard stack before I have a chance to review and post-process the input frames. Focus bracketed image series can later be hand-processed in RAW, and then stacked efficiently on a real computer using scripts or software products.

Here are two representative individual frames (I have been stacking 6 to 25+ frame in total):

Loading...
frame #9 | MFT 90mm @~32.5cm 1/40s f/6.3. Mouth parts are resolved

ajustinfocus.com

frame #9 | MFT 90mm @~32.5cm 1/40s f/6.3. Mouth parts are resolved
Loading...
frame #15 | MFT 90mm @~33.0cm 1/40s f/6.3. One claw resolved

ajustinfocus.com

frame #15 | MFT 90mm @~33.0cm 1/40s f/6.3. One claw resolved

Below is the stacked composite, which given enough frames, moves toward an f/‘infinity’ depth of detail on the subject (with some caveats):

Loading...
The focus-stacked image, 25 frames spanning a ~1.5cm wide DoF and focal range (32.0 to 33.5cm)

ajustinfocus.com

The focus-stacked image, 25 frames spanning a ~1.5cm wide DoF and focal range (32.0 to 33.5cm)

While the focus stacked composite is not free from artifacts, the level of detail across the whole subject is impressive!

For this live animal I did not even think about trying to collect an f/22 image for comparison, due to my use of existing ambient lighting in the environment. This made collecting 25 focus bracketed frames a simple, near instant task for my OM-1, as there was no need to wait for my flash to recharge between frames (typically ~0.1s for a decent flash on low/medium power – this can add up, especially with the potential for subject and camera motion).

Reduced light level requirements is another advantage of being able to work at wider apertures, relieving demands on the recycle time of flashes, or in some cases needing no flash or additional lighting at all.

Blasting this crab with a blinding flash on its highest setting would not only have been a cruel and unnecessary thing to do, but also would have yielded an image with limited fine detail and resolution due to high diffraction.

Stacking ‘in post’

There are multiple ways (and products) to do focus stacking, but here is one open-source solution that I have used.

My semi-manual stacking process lately involves:

  1. hand-tuning RAW images in Darktable , resulting in an .xmp file > (close)
  2. run darktable in CLI mode, applying the .xmp operations to rest of images > .tifs
  3. focus stack the .tifs

A minimal terminal workflow:

 #!/bin/bash
xmp=$1
wd="./"

darktable-cli $wd $xmp frame.tif

prefix='stack'

focus-stack --output=${prefix}.jpg *tif &&
open ${prefix}.jpg # 'open' command on macos

Caveats include:

Conclusion

The competing demands of lighting, speed, quality and depth of field are fundamental to the art of photography, whose opportunities and pitfalls are with a careful consideration. For small, close subjects (‘macro’), a good focus stack can yield a detailed, medium-level focus and blur look closer to what we are used to in non-macro photography.