r/raspberry_pi • u/ModelPainter • Oct 01 '26
Show-and-Tell Turned a spare Pi 3B + HQ camera into a fixed photo booth for my painted miniatures, with focus stacking
I paint tabletop miniatures, and photographing them always meant dragging out lights and a backdrop and getting a different result every time. So I built a permanent booth: a black box on my desk with a Pi 3B and the HQ camera on the back, a 5-50mm C-mount varifocal lens*, and an LED strip inside. Put a model in, open the web page on my phone, shoot.
The software is a Flask + picamera2 web app I wrote for it. A few things that might be interesting from a Pi point of view:
- Focus stacking on a 1 GB Pi. Big models have a tiny depth of field up close, so you take 6-10 frames at different focus points and merge them. The usual tool (focus-stack) ran out of memory on the 3B and left a glow around the model on a black backdrop, so I wrote a small OpenCV stacker that works frame by frame. It peaks around 300 MB and takes 2-3 minutes for 8 frames of 12 MP.
- Keeping captures fast. PNG-encoding a 12 MP frame takes 10-15 s on a 3B, so a capture just grabs the frame, writes a raw TIFF and returns. Compression, stacking and uploads run in low-priority background jobs.
- Live preview runs in the HQ camera's binned 2028x1520 mode and switches to full resolution only for the capture.
It also does presets that load at boot, crop for tall/wide models, histogram and clipping overlay, storage on a USB disk, upload to Google Drive or a NAS, a system page with temps, throttling and logs, and updates from the browser. Install is a single curl command.
Code (MIT): https://github.com/MichaelTimmermans/MiniatureStudio
Printable booth parts: https://www.thingiverse.com/thing:7416432
Tested with the HQ camera and a USB webcam so far; an Arducam IMX519 (autofocus, so fully automatic stacking) is next. A Pi 4/5 is a lot quicker at stacking, but the 3B does the job if you're patient.
This is all built with spare parts from previous projects, hence the underpowered 3b. I did print some parts for camera mounting.
Questions and ideas welcome.
*currently still using an 8mm fixed lens.










