How To: Use a Flatbed Scanner and Raspberry Pi to Take Super Sharp Macro Photos

Use a Flatbed Scanner and Raspberry Pi to Take Super Sharp Macro Photos

You can take macro photos on a huge variety of devices, whether you're using a DSLR with expensive lenses or just your iPhone (or any smartphone, for that matter). One common issue, though, is that it can be hard to get the image as crisp as you want because the depth of field is so small.

David Hunt had an old flatbed scanner sitting around, and he figured he could kill two birds with one stone by using it to create a setup that solves the focus problem with macro photography.

In combination with a Raspberry Pi, the scanner moves his camera a tiny bit at a time and takes a bunch of photos which can be stacked together to create one super sharp image.

Image via

The Raspberry Pi is attached to a stepper motor drive and his camera's shutter. It moves the camera at various speeds, sometimes as little as .02mm at a time, using the shutter release to take a photo each time.

The photos are then stitched together using a free, open-source program for Windows called CombineZM. All you have to do is load the photos into the program and go to Macro -> Do Stack.

Image via

It will automatically line them up and apply the appropriate filters. If this doesn't get the results you want, you can also stack them manually. If you can't get CombineZM, you can also use Photoshop to do some depth of field blending.

Check out the video to see the setup and how it works.

For more details and all the code, head over to David's website. You can find a full tutorial on stacking images in CombineZM over on Wonderful Photos.

Just updated your iPhone? You'll find new emoji, enhanced security, podcast transcripts, Apple Cash virtual numbers, and other useful features. There are even new additions hidden within Safari. Find out what's new and changed on your iPhone with the iOS 17.4 update.

Be the First to Comment

Share Your Thoughts

  • Hot
  • Latest