Focus stacking and image stitching



Inspired by Manu’s previous post regarding focus stacking (, I decided to try out the technique myself. Since I was testing a focus locking prototype of the Foldscope, it was very easy for me to progress through a series of focal lengths. For my first attempt, I imaged the remnants of a bryozoan colony that had grown on a blade of marine algae that I found on the beach. Apologies in advance, I forgot to take a macroscopic picture of the algae and bryozoans. Bryozoans are tiny colonial invertebrates, and these particular ones happen to be epiphytes that settle and grow on top of algal blades.



Above is an image of the bryozoan colony. Each animal in the colony lives in its own individual chamber, and it feeds by extending its tentacles into flow. Although the animals are long-gone, the chambers within the rigid exoskeleton remain. Since the exoskeleton was 3-dimensional in nature, I thought it would be the perfect candidate for focus stacking.


Here is the result of stacking 8 images together in Photoshop (see I must admit, the results are amazing. You can see a high level of detail across virtually the entire field of view. I am guessing that the tentacles would have emerged from the circular openings on the right side of each chamber.


Seeinng these promising results,  I decided to take things a step further: imaging an entire organism that was larger than the Foldscope’s field of view by stitching multiple images together. Previous attempts at stitching multiple images together proved unfruitful, largely because only part of each image was in focus. I had hoped that focus stacking would alleviate this issue. For this experiment, I decided to use another marine animal: a barnacle that I had removed from its home (see Below are a couple of images of the critter (no focus stacking yet).


As you can see, it is nowhere near fitting within the field of view. In fact, this particular barnacle ended up spanning about 8 fields of view. In total, I took about 30 pictures of the barnacle at various places of its body and at different focal lengths. I created a single focus stacked image for each particular field of view, then combined these new images by aligning them in photoshop (using the auto-align function). The result turned out even better than I expected!


Though there are blurry regions, the overall image is very sharply in focus. This is my first time using the Foldscope to capture the entirety of an organism that is several millimeters long. Hopefully in the future I can find a freeware solution to create images such as these, perhaps through a program such as GIMP or ImageJ. I am very much open to ideas and suggestions!


Here are a couple of bonus images using the same technique. First is a bee leg:


Second, here is the compound lens of the same bee’s eye:


4 Comments Add yours

  1. Matt.Rossi says:

    Oh my word, @Tom those images of the barnacle are absolutely works of art! What gorgeous shots these are! I seriously want to hang that on my wall.

  2. Lydia says:

    WOW, this was a great challenge – with stunning results!! Foldscope is now also a deconvolution scope with stitching and tiling capabilities! Did you check how long this took you? Even for experienced Foldscopers, microscopists and photographers, probably quite some hours… Congratulations!

  3. laksiyer says:

    Stunning pictures @Tom. There is another focus stacking freeware CombineZP. I have played around a bit with ImageJ, but not CombineZP, although I see a lot of focus stacks with the latter in amateur microscopy websites.

  4. joachim says:

    Great attempt, we are often using CombineZM/ZP or Image Analyzer for stacking, both are freeware. For stitching Photoshop CS3 had the best possibilities. A good freeware alternative is Microsoft Image Composite Editor.

Leave a Reply