pibooth project attempts to provide a photo booth application out-of-the-box
in pure Python for Raspberry Pi.
The requirements listed below are the one used for the development of
pibooth, but other
configuration may work fine. All hardware buttons, lights and printer are optional,
the application can be entirely controlled using a standard keyboard.
- 1 Raspberry Pi 2 Model B (or higher)
- 1 Camera (Pi Camera v2.1 8 MP 1080p or any camera compatible with gPhoto2)
- 2 push buttons
- 4 LEDs
- 4 resistors of 100 Ohm
- 1 printer
A brief description on how to set-up a Raspberry Pi to use this software.
Download latest Raspbian image and set-up an SD-card. You can follow these instructions .
Insert the SD-card into the Raspberry Pi and fire it up. Use the raspi-config tool that is shown automatically on the first boot to configure your system (e.g., expand partition, change hostname, password, enable SSH, configure to boot into GUI, etc.).
Don't forget to enable the camera in raspi-config.
Reboot and open a terminal. Install the latest firmware version:
$ sudo rpi-update
Upgrade all installed software:
$ sudo apt-get update $ sudo apt-get upgrade
gPhoto2(required only for external camera):
$ sudo wget raw.github.com/gonzalo/gphoto2-updater/master/gphoto2-updater.sh $ sudo chmod 755 gphoto2-updater.sh $ sudo ./gphoto2-updater.sh
CUPSto handle printers (more instruction to add a new printer can be found here):
$ sudo apt-get install cups libcups2-dev
piboothfrom the pypi repository:
$ sudo pip3 install pibooth
If you don't have
CUPSinstalled (steps 5. and/or 6. skipped), use the
--no-depsoption to avoid installation failures (you may need to install Python dependencies by yourself)
Start the photo booth application using the command:
All pictures taken are stored in a subfolder of the one defined in the configuration, named YYYY-mm-dd hh-mm-ss which the time when first picture of the sequence was taken.
Note that if you have both
gPhoto2 cameras connected to the Raspberry Pi, both are
used. The preview is taken using the
Pi one for a better video rendering and the capture is
taken using the
gPhoto2 one for better picture rendering.
You can display a basic help on application options by using the command:
$ pibooth --help
After the graphical interface is started, the following actions are available:
|Action||Keyboard key||Physical button|
|Toggle Full screen||Ctrl + F||-|
|Choose layout||LEFT or RIGHT||Button 1 or Button 2|
|Take pictures||P||Button 1|
|Export Printer/Cloud||Ctrl + E||Button 2|
States and lights management
The application follows the states sequence defined in the diagram below:
The states of the LED 1 and LED 2 are modified depending on the actions available for the user. The LED 3 is switched on when the application starts and the LED 4 is switched on during the preview and photo capture.
Final picture rendering
pibooth application handle the rendering of the final picture using 2 variables defined in
the configuration (see Configuration below):
[CAMERA][resolution] = (width, height)is the resolution of the captured picture in pixels. As explained in the configuration file, the preview size is directly dependent from this parameter.
[PICTURE][orientation] = auto/landscape/portraitis the orientation of the final picture (after concatenation of all captures). If the value is auto, the orientation is automatically chosen depending on the resolution.
The resolution is an important parameter, it is responsible for the quality of the final picture. Have a look to picamera possible resolutions .
Install developing version
If you want to use an unofficial version of the
pibooth application, you need to work from a
clone of this
git repository. Replace the step 7. of the Install procedure above by the
clone from github
$ git clone https://github.com/werdeil/pibooth.git
go in the cloned directory
$ cd pibooth
piboothin editable mode
$ pip3 install -e . --user
start the application exactly in the same way as installed from pypi. All modifications performed in the cloned repository are taken into account when the application starts.
At the first run, a configuration file is generated in
which permits to configure the behavior of the application. The configuration can be
easily edited using the command:
$ pibooth --config
The default configuration can be restored with the command (strongly recommended when
$ pibooth --reset
See the default configuration file for further details.
Here is the default configuration used in CUPS, this may depend on the printer used:
|Media Size||10cm x 15cm|
|Media Type||Glossy Photo Paper|
|Shrink page ...||Shrink (print the whole page)|
The print button (see Commands) and print states are automatically deactivated if:
- pycups is not installed
- no printer configured in
Here is the diagram for hardware connections. Please refer to the configuration to known the default pins used.
Icons from the Noun Project
- Thumb up by Symbolon
- Polaroid by icon 54
- Cat by Внталий Плут
- Up hand drawn arrow by Kid A
- Cameraman and Friends Posing For Camera by Gan Khoon Lay