Focus Stacking - worth it?
I had a bit of a eureka experience with an image I've been chasing for some time this week, and have been asked a few questions about how it was made, so I thought it might be worthwhile writing a blog post on it - also a good thing for me to look back at for my own benefit when trying similar things in the future.
Dragonflies are a particular favourite subject of mine. I find their whole life cycle utterly fascinating, and the intricacy of their design is one of the great marvels of nature. For a creature so small to have complete independent control of four wings larger than their body size makes them arguably the most agile flying machines on earth. Huge compound eyes give them near 360 degree field of vision, and they eat midges. What's not to love!!
As with a lot of insect photography, scale is often difficult to gauge from photos. We become accustomed to seeing close-up images and forget how tiny these creatures are. The subject of this blog is one of my favourite dragonflies, the Black Darter.
I spent some time last summer photographing these dragonflies near my office, but confined to lunchtimes, this was difficult because they are very active and camera shy in sunshine. Earlier in the year I discovered a new location for Green Hairstreak butterflies at Pitdelphin Wood near Strachan, and it immediately struck me that it had great potential for dragonflies and damselflies too - and I wasn't wrong! This site is literally teeming with damselflies - large red, emerald, common blue and azure. It's also teeming with ticks and deer flies, which is less pleasant!
The site also has golden ringed dragonflies, common hawkers, four-spotted chasers and a very large population of black darters. Given more time exploring the site, I'm convinced it might throw up some less common species too. In terms of butterflies, it has also proved good for ringlet, meadow brown, small pearl-bordered fritillary, speckled wood, orange tip, small copper and of course the wonderful green hairstreak. Constant overhead noise from a family of buzzards, and the chirping of crossbills adds to the atmosphere of the place. It's an absolutely wonderful place to visit at any time of the summer.
The answer to photographing dragonflies and damselflies is definitely timing - find out where they will definitely be, and go very early in the morning before they have warmed up. This also provides the opportunity see see them emerging from their exuvia. They typically crawl out of the water at night, and emerge at dawn, drying out and pumping up their wings over the next few hours. The picture above kind of sets the scene for the difficulties in photographing them. Even at this stage in their life-cycle, they move A LOT, so getting images that can be focus stacked is a real challenge. This image looks OK at a first glance, but there are areas where the subject has moved between frames and compromises on sharpness have resulted.
The other main problem with this picture is that some kind person decided to camp there the night before, and lit a fire, so all of the grass around the pond was covered in ash. How utterly thoughtless is THAT?!?!
I found three hawker/golden ringed dragonfly exuvias too recently - wish I'd been there to see them emerging!!
So this all kind of leads on nicely to trying to get a really good image of these amazing creatures. The main issue is that they are really small, and have incredibly intricate, and reflective, wings and eyes. For most macro photography, especially butterflies, I adopt a method of using fill flash to allow me to use an aperture of around f9 or f10, at ISO100 and a shutter speed of 1/250th of a second. This is my 'starting point' for settings, increasing the aperture and reducing the shutter speed incrementally to ensure it is suitably exposed.
*** Geekery section alert - skip to the next paragraph if you wish ***
Another key element to this is how digital cameras deal with exposure. What I say here might not be 100% accurate, but from what I have read and watched, I BELIEVE this to be true of most digital cameras. The difference between ISO100 and ISO400 for example, is 2 stops of light, but the camera does little more than boost the signal received from the sensor. The difference between an image taken at ISO400 and the same image taken at ISO100 with exposure boosted by 2 stops in post production is negligible. Tests have shown that it is not identical (due to different algorithms), but the difference is almost zero. When dealing with bigger increments in ISO, there are more significant differences, but my understanding is, that typically for ISO's under 1000, the difference between exposing correctly in camera and underexposing and fixing it later in post production is effectively the same. For this reason I will typically stick to a very low ISO for butterflies, because using fill flash on a close subject generally means it's predominantly the background that will be underexposed, and I know I can bring that back 2 or 3 stops in post production. This lets me keep the all-important shutter speed up as high as possible, and the aperture as small as possible, and minimises the number of variables in the field.
*** Geekery section ends ***
I've tried this approach with dragonflies too, and it is a different story altogether. Their principle features - intricate wings and eyes - are highly reflective, and/or transparent, and reflections and glare can ruin an image. At this distance, using flash with reflective surfaces and a shallow depth of field also creates major issues of chromatic aberration - easy to fix in a single image, but destructive when stacking multiple images (purple fringing is particularly noticeable in out of focus highlights).
After numerous attempts, I finally feel I have an image that I'm really chuffed with. I will run through the process of how I shot and edited it, and then at the end show how the resulting image compares to other attempts using different settings.
The setup shown above was actually from a different image (shown below) which was almost a success. The process is the same though. I found a nice clean rush (I'm crap at plants but I think this is probably Juncus Effusus - Soft Rush) and plucked it from the base of the stem. Rushes are ideal, because they are easily strong enough to hold the weight of a dragonfly, and yet not dominate the image. In this example I poked it through the strap of my camera bag to hold it in position, set up the camera on a tripod, focused on the grass, and ensured this gave me a clean background at an appropriate f-stop. It's wise to take a few test shots to gauge exposure settings too, before going in search of a dragonfly.
The benefit of doing this in the early morning is that dragonflies not only tend to stay still, they'll also happily hop onto your hands as it is warmer than the grass they roost on. It's typically pretty easy to find an accommodating subject that you can then coax onto the stem of rush in the right place.
For the next image, I positioned the rush stem on a Scots pine sapling, so I could work standing up. There was absolutely no wind, so there was less need to set things up close to the ground. The example above encouraged the dragonfly to move too much too - they prefer to roost on vertical stems rather than at this jaunty angle.
Set up therefore, looking down slightly onto the dragonfly, I was happier that he wasn't going to move too much, allowing me time to take pictures. The first attempt was done using flash, at f5.0, ISO200 and a shutter speed of 1/160th second. The flash was set to about 1/8th power. I ended up stacking from around 6 images, and the result was OK. However, the increments of the stack were too big.
Basically, I use manual focus, and focus until just before the insect begins to come into focus, and take the first image, thereafter moving the focus ring by a tiny increment between each shot until the insect is no longer in focus at the other end. The other method of doing this would be to use macro rails and move the camera rather than the focus ring, but out of a studio setup this would be incredibly difficult. In the case I'm using as an example here, the camera was awkward enough to position on a ballhead tripod, let alone trying to align rails.
*** Geekery section alert - skip to the next paragraph if you wish ***
Focus breathing is an issue here - as you move the focus ring, even though you are using a prime lens (in my case a 105mm macro lens) the effective focal length changes. So while this might be 105mm when focused to infinity, when focused to 35cm it becomes say 96mm. Not an issue at all for normal photography, but when aligning images in a stack it can make like a little difficult. If you take 20 images, the subject might be a few percent larger at one end of the stack from the other. It's worthwhile considering this when aligning them in photoshop.
*** Geekery section ends ***
I had various attempts at creating a stack of images, at different settings and flash powers. However, when I got back to the computer I was typically disappointed in the results of the images taken using flash, for the reasons mentioned above. However, I had taken a couple of stacks without flash, and this is where I found the best results.
A couple of these attempts were fails, because a tiny bit of camera shake in the middle ruined the whole effort. Shutter speeds are typically lower without flash, and this brings a new concern. You can use a shutter release or a 2 second timer to ensure the camera settles between shots, but 20 images can therefore take probably 2-3 minutes to shoot, and there is every probability that your dragonfly will move during that time span (or you get eaten by midges). An alternative is to firmly hold the lens and camera in two hands, on the tripod, with one hand on the focus ring and one on the camera body and shutter. Turn the focus ring and shoot the image, and repeat, never letting go with either hand. I have found that with care, this approach is successful with shutter speeds down to around 1/40th or 1/50th second without compromising sharpness. It means I can fire off 20 images in around 30-40 seconds - far more chance of the subject remaining still.
Note - always turn image stabilisation OFF for this. It tends to 'float' meaning the position of the subject in the image will move, and you will have to crop more off the edges of the image when you align them in photoshop. I am also convinced that this float changes the focal plain and has ruined stacks - but I haven't tested this definitively. Similarly, I always shoot this in 'live view' because it locks the mirror up and removes another source of potential shake and loss of sharpness. I don't really look at the screen between the first and last image, but it does let you see when you are reaching the end of the stack.
Another tip, which I'm sure you have seen before, is to take a photo of your hand between stacks, so it's easy to see on the computer where they start and end. As usual, I am using Bridge to browse my files, and have selected the 21 images here that formed this stack. Lightroom is also ideal of course, Bridge and Camera Raw is just my preference.
These were taken at f3.2, ISO200 and a shutter speed of 1/50th second, with no flash - using the two hands on the camera approach described above. The metadata actually tells me that the first image was created at 6:19:10am and the 21st at 6:19:53 seconds - so it took me 43 seconds to take the pictures. Flicking through them in Bridge I can see that the subject did not move, so the first challenge is complete! A number of other stacks were thrown away because the dragonfly moved a wing or a leg - or decided to clean his eyes (they do that a lot).
I then open these images in Camera Raw and apply the most basic of adjustments to all of them together. I apply lens correction and chromatic aberration removal as the number one priority, and typically add some clarity and vibrancy (+20) as a standard edit. I then click done to return to Bridge.
With the 21 images still selected, I then go to the Tools menu, select 'Photoshop' and 'Load files into Photoshop layers...'
This is where the fun really begins! The first task in photoshop is to select all layers, then from the Edit menu, select 'Auto-align layers' and OK the default settings. This typically does a good job of aligning all the layers - and you'll be glad you remembered to turn off the image stabilisation at this stage!
Then comes my first real 'tip of the day' - select all layers, right click and click 'duplicate layers'. I then create the stack from the duplicates and still have the original, aligned layers to use to touch up bits that photoshop makes a mess of - and it will!
Only problem is that now we are working with a file that has 42 layers and is 5.2GB in size! Some processing power definitely helps from now on.
Now, photoshop is OK at stacking images, but it isn't perfect. I'm sure that in a studio set up using rails and taking hundreds of images in minuscule increments, it would be excellent, but this is out in the field with the smallest increments possible within the confines of the equipment. Where it falls down is where there is an overlap - for example wings over a plant stem, where there is a space between them. While it will probably stack sections of the image very well, it will fall over on overlapping elements.
Top tip number 2 is therefore to tackle it in smaller stacks. In this case I did three stacks - the hind wings, the fore wings, and the legs and rush stem.
I then used individual layers saved at the start to touch up specific areas that were not perfectly stacked. In particular, the area where the wings overlap, photoshop gets very confused and makes a bit of a mess.
To fix this, I'd select the original layer where the relevant part of the wing is in sharp focus, duplicate that layer and drag the duplicate to the very top of the stack, create a layer mask and leave only the required section to replace the bit that photoshop made a mess of. Hard to explain in text here, but the most difficult thing is keeping track of what layer is what. This is why I always maintain a full set of unstacked layers at the bottom, so I can always fix a mistake at any stage, whether I make it or photoshop fails. It's a laborious process with dragonfly wings, but it's very much worth getting it right I think.
Having tidied up the three stacks, I then combined them - firstly the two sets of wings, and then finally with the legs and rush. The last part was, by far, the hardest part of the process, and one that had to be done manually. Trying to combine the dragonfly and the rush automatically simply confuses photoshop, and a mess of wing and rush results, with odd sharp bits and odd blurry bits.
The answer was to overlay the images manually and then use a layer mask to remove the top layer and reveal the rush and legs below. Yes - this means section by section across the wings! This is the part of the process that took around 5 hours to complete, done with a 4-6 pixel brush and zoomed in to 500%.
It was really only at this stage that I was sure that the process was going to be successful - it can go wrong anywhere along the line and the tiniest missing element of sharp focus, camera shake on one layer, a previously unnoticed movement by the subject can ruin it all. Thankfully, this one worked!
The final part of the process was to tidy up the wings a little. Where the water droplets sit on the dragonflies body, these add something to the image, but on the wings, where there are more layers showing, and a greater depth of field, these begin to look really messy, with a sharply focused droplet overlaying an out of focus image of the same droplet - and the associated purple fringing on the out of focus layers. The easiest method is simply to remove them with the clone stamp and tidy it up. There were also small areas still where the stacking had failed, and could be tidied up from the original images.
The final step was fine tuning the adjustments in camera raw - a little more vibrance, and bit of dodging and burning, and a very slight crop to balance up the composition, and then some slight noise reduction and sharpening in Imagenomics Noiseware. By way of comparison, the image below is the same dragonfly taken using flash, and stacked from just 6 images. To my eye, the naturally lit image looks superior in every way, and was well worth the greater effort to complete it.
So that's it, the laborious process of focus stacking insects. To have a dead insect set up in a studio with geared focus rails and perfect lighting conditions, creating hundreds of images to put into a specialist programme like Zerene Stacker or Helicon might yield perfect results with little more than processing power and time, but I'm only interested in photographing live subjects in their natural environment, so as far as I can see, this is about the best solution for doing it. It was hard graft, but I've learned loads about dragonflies along the way, as well as photography techniques - and learning is always good. I now look forward to the image getting 13/20 in the first competition of the season :D