Foldscope focus stacking for high depth of field images

Microscopy always brings a challenge for imaging truly 3D subjects; since the depth of focus of most optical elements is small. Thus one choice you have as a microscopist is to squeeze something really flat in a slide – but this option will most likely kill and distort the sample you are trying to image. Another trick; which I describe briefly here – is focus stacking. This is a very common technique used in macro photography (you can read more about it at many places 0 including here: or

To achieve a high depth of focus image using Foldscope; firstly you need to take images at different focus with a foldscope and use simple tools to “blend” all the images with focused regions to form a single image which is in focus everywhere.

A) Mount your sample in usual ways. Choose a sample that has some three dimensionality to it – for example an insect. I choose an unidentified insect that was walking in the root system of a patch of grass growing in my balcony.

B) Keep the foldscope and your cellphone to record the images from on the table (I had described a simple way using A4 sheets of paper before – see an old post:

C) The goal is to take a few images at different focus; and we will merge/blend them together to form a single image. I am using an iPhone6 right now; and in camera->photos; when I select a timer – the phone naturally collects 10 or 11 images in a quick succession. So all I need to do is change focus while these images are taken. I simply achieve this by putting a small weight on the phone; and quickly but gently removing the weight while the pictures are being taken. This allows me to translate the focus very gently but precisely in a quick succession. You can also do this using the standard imaging by putting the phone on the edge of the table.

Here is an example of two of the total 10 images I captured. The different focal planes is clearly visible.



D) I also tried an automated way to generate a focus stack. Since an autofocus feature exists in most common phones now a days – I used a a feature to move the focus in an automated manner. This is exposed in many apps – one that I tested and got to work well is “Stay Focused”. I am still not happy with the results for the same (since it collects the images but does not save them). Once I have the exact processed worked out – I will post it again here.

E) Now once you have your stack of images – you can use several simple tricks to make a focus stack.
1) Use Photoshop to just automatically blend the images. See video tutorial here:

Here is my result from the same.

2) Since not all of us have access to Photoshop – you can also use free tools; such as gimp or imageJ to blend images to make a focus stack. See video tutorial for the same here:

Here is my result for the SUM and AVG techniques described above. I am yet to try GIMP.



3) For some really good results – several professional (but expensive) tools exist – one of them is helicon focus. People can comment how much they like and the quality of results obtained. Link here:


ps: Now, can anyone identify this special bug. It’s very small (roughly 2mm in length); and has a very peculiar pattern on the head and on legs (stripped red legs). I found this inside the mud in roots of grass. I will post videos of trachea and pumps in the live organism in my next post.

9 Comments Add yours

  1. Aaron says:

    Hi Manu, awesome shots! I haven’t tried photostacking with my phone yet but will give it a go.

    The insect appears to be a springtail (Collembola) See if you can take some images of an organ called the furcula on the fourth abdominal segment; it will look like a little forked latch. This mechanism “springs” into action and launches the tiny arthropod away from predators, which is why they are called springtails!

  2. Manu Prakash says:

    @Aaron: thanks Aaron. I would love to use your expertise in focus stacking. Would love to read your post on tricks and techniques and learn from pros.

    I have the sample preserved – so will look at it tonight. I also came up with a really simple way to trap tiny insects so as not to damage them in the process. Very valuable – I woke up today and my little big was still alive and kicking after 10hrs of being frozen in place.

    I will look for the “spring tail” – I have worked on the physics of some spring tails; specially the one that can jump on water interface. It walked too fast for a spring tail and I never saw the deployment in an hour I watched it. But again; I will post a detailed mosaic of the dorsal and ventral side.

    Do you have a fav mosaic software you like. I am going to combined multiple fields and multiple focua stack to make extremely detailed images. I am excited about that as an Excercise.

    More soon.. See you in a couple of weeks.


  3. Manu Prakash says:

    @Aaron: j am linking the other sprig tail post I made. I don’t believe this one is (but I am not sure) – but here is one for sure. I know you will enjoy this post.

  4. laksiyer says:

    Brilliant.. I like the weight idea…

  5. Aaron says:

    Hi guys, my mistake – taking a second look it’s probably a Psocoptera, commonly known as barklice. Other angles of the insect can confirm, here’s one for reference
    @Manu, I’m primarily using photoshop right now to organize & clean up images – looking forward to seeing what else you come up with!

  6. Manu says:

    Aaron: that’s exactly right. Barklice.. I really like the patterns on the head..

  7. Pedro Almada says:

    Hi! Just to say you can do better with ImageJ using this:

  8. Manu says:

    Thanks @Pedro. I will give this a try.


Leave a Reply