After googling around, I found no viable photo booth software for my setup. So here is yet another photo booth for the Raspberry Pi.
https://youtu.be/9JJbJjKcDA4
Features:
- Saves photo to file and optionally prints it
- Interface with pictograms and colors instead of text
- Large touch screen friendly buttons
- Countdown to taking picture
- Picture review to decide about printing (60 sec timeout)
- Print queue awareness (won’t print unless queue is empty)
- Infinite loop
- Written in Python 3 and tkinter
What you need is:
- any Raspberry Pi with camera port
- a Raspberry Pi camera
- a display; cheap touch screen LCDs are a good fit for this
- a printer that works in CUPS, set as default printer
- some extra packages installed: python3-cups python3-image-tkinter cups (get python3-cups from https://launchpad.net/ubuntu/trusty/armhf/python3-cups/1.9.66-0ubuntu2)
- the code and pictograms
Installation and usage:
- Save the code and pictograms under /home/pi
- Run with ‘python3 photobooth.py’ (put a shortcut on the desktop for easy access)
- Photos are saved to /home/pi/Pictures by default
- ESC-key exits
Add internet connectivity and some cloud service synchronization with just a password to your Pictures folder to give your guests near instant access to photos.
The set can then be mounted in some nice way, for example like this with a case and tripod:
I really like your approach. Can I ask how you were able to get python3-cups on your pi? My sources are unable to locate it. Thanks!
Hi Jon, and thanks! Sure, I faced this as well and put a note of it in the code:
For some reason, python3-cups is missing from raspbian, use pip or this:
https://launchpad.net/ubuntu/trusty/armhf/python3-cups/1.9.66-0ubuntu2
Also, add pi to group lpadmin:
sudo usermod -a -G lpadmin pi
Enjoy!
I found the link in your python script. Thanks for including it and I’m sorry I didn’t see it before asking. Great example!
Hello Johan,
i like yout photobooth setup. Do you have an autostart-function? (when the pi boots, the software automatically starts)
And what cloud service do you use? I wanted to use Dropbox, but i don’t get it to run on my Pi3.
greetings
Ben
Thanks for the feedback! Yes, it can easily be added to the graphical environment startup with the following command when installed in the home directory root:
echo "@python3 photobooth.py" >> ~/.config/lxsession/LXDE-pi
Hi Johan,
This is a great project, I like the simplicity of your program, ordered a Pi camera to test it !
Is there a way to get a live preview from the camera ?
Best,
Frédéric
Nice to hear Frédéric! Yes you can technically add live preview (see
start_preview()
andstop_preview()
). In my tests it affected the camera automatic settings and timing. If you find a nice way of adding it to the app, I can include it here. More details here for anyone who wants to tinker: https://www.raspberrypi.org/learning/getting-started-with-picamera/Hello Johan, how I do if I do not want to add prints
Hi, changing line 131
reviewPhoto(filename, 60)
towaitUser()
should do the trick. It essentially skips back to the start after a picture was taken.Hi, I have a problem with python :
Traceback (most recent call last):
File “/home/pi/photobooth.py”, line 23, in
from PIL import Image, imageTk
ImportError: cannot import name ‘imageTk’
Hi, make sure you have the required packages installed, specifically
python3-pil.imagetk
.Hello again Johan.
I would like to control my picamera with scale (Iso, saturation, contrast).
How can I do? Thank you ! 🙂