I had built a Photobooth in 2019 based on Wyolum’s Raspberry Pi Photobooth project as posted in Make Magazine. Caroline Dunn made a YouTube video of her build, which explains different aspects of the project.
I had two events where the photobooths could be used, so I pulled them off the self and tested them. The first one started just fine, but the SD Card soon became corrupted and would no longer boot. I flashed the SD Card with the latest Raspbian OS and installed the software, but it would not run. There have been changes to Raspbian and in particular with Python on the latest Raspbian build which will not allow the previous code to run. The Wyolum TouchSelfie project has not been updated in 6 years, so there have been no updates to allow it to run on the latest Raspbian distribution. There is the option of using the older distribution, but I did not want to take that path.
I moved forward by attempting to make fixes to the software but ran into several issues, which led me to do a complete rewrite. Not all features are working at this time, but the important ones, such as taking the photo, creating collages & animated GIFs, adding frames with logos, and uploading the photos to a Google Album are working. I also have some ideas for taking the project further, which will be covered at the end.
Bill of Materials (BOM)
- Raspberry Pi 3 or newer
I would recommend a Raspberry Pi 4 or 5 as it may handle rendering of the photos better than the Raspberry Pi 3, although the Raspberry Pi 3 works well. - Raspberry Camera Module 2 or newer with cable
NOTE: Raspberry Pi 5 requires a different cable than earlier versions. - Raspberry Pi 7″ touch screen
NOTE: The original Raspberry Pi 7″ touch screen (800×600) was used but the new version 2 (720×1280) will work as well. Raspberry Pi 5 requires a different cable than earlier versions. - Power Supply
NOTE: The official Raspberry Pi Power Adapter for the Raspberry Pi 3 was not sufficient. It required a 12W iPad charger to work. Amazon has some Anker 2-Pack Dual Port 12W USB A Charger Blocks that I purchased, which work as well. - (Optional) Waveshare Barcode Scanner Module
Plugs into Raspberry Pi USB port and Acts like a keyboard. Makes it convenient to run specific commands or shortcuts without connecting a keyboard. Also may be used to enter email addresses for sending photos. - (Optional) GPS USB Dongle
Allows geotagging of photos- G72 G-Mouse USB GPS Dongle
Has battery to allow faster startup. - VK-172 USB GPS Dongle Receiver
No backup battery. May take 30 minutes or longer to obtain location fix every time.
- G72 G-Mouse USB GPS Dongle
- 1/8″ plywood cut with the SVG files at https://github.com/richteel/Photobooth
Path: /fabricate/Rich/
Write the Raspbian OS to an SD Card
- Write the latest Raspbian image to an SD Card using Raspberry Pi Imager.
- Click the “Choose Device” button and select “Raspberry Pi 3” from the list.

- Click the “Choose OS” button and select “Raspberry Pi OS (64-bit)”.
- Click the “Choose Storage” button and select the SD Card from the list.

- Click the “Next” button and follow the prompts. Once the card is validated and you receive a confirmation message that the image has been written to the SD Card, remove the card from the computer and move it to the Raspberry Pi Zero 2 W board and power it on.

- Click the “Choose Device” button and select “Raspberry Pi 3” from the list.
- Once the Raspberry Pi boots up, and finishes setting up, log into the Raspberry Pi. You may do this directly with an attached keyboard and monitor or by connecting with SSH.
- Connect to the Raspberry Pi or use a connected keyboard.
- If you had edited the settings prior to writing the OS to the SD Card and the setting included the information to connect to your WiFi and enabled SSH, you may SSH into the Raspberry Pi to run the following commands.
- If you did not setup those options or if wish to use Raspberry Pi Connect, you may connect a keyboard to the Raspberry or use the on-screen keyboard.
Recommend using a connected keyboard if you working directly with the Pi. - Recommend Turning on Raspberry Pi Connect, Sign In, and work from another computer.
Update Raspbian and Install Packages
- Update the Raspberry Pi OS and install packages by running the following code.
sudo apt update -y && sudo apt upgrade -y
# Install ImageTk, Image from PIL
sudo apt install python3-pillow
sudo apt install python3-pil
sudo apt-get install python3-pil.imagetk
sudo apt install python3-numpy
# Install ImageMagick for the 'Animation' mode
sudo apt-get install imagemagick
# Install picamera2 depenancies
sudo apt install libcap-dev
sudo apt install libcamera-dev
sudo apt install libcamera-apps
# Add support for Pi Camera ?
sudo apt install python3-picamera2
# Add support to write extended EXIF data
sudo apt install python3-piexif
# Create virtual environment for gdata
python -m venv ~/photobooth
source ~/photobooth/bin/activate
# Install google data api and upgrade it
pip install gdata
pip install --upgrade google-api-python-client
pip install --upgrade oauth2client
# Install ImageTk, Image from PIL
# Appears we need to do this in the virtual environment too.
pip install pillow
# pip install numpy
# Leave the virtual environment
deactivate
Setup Google API Access
- Open a web browser and log into your Google Account. If you do not have one, create one.
NOTE: You may want to create a separate account, just for the photobooth to keep it separate from your main account. - Go to the Google API Console
- If you are not in the correct profile, select the correct profile.

- If you are not in the correct profile, select the correct profile.
- Create a project
Click on the project selector near the top of the screen, then click the “New project” button in the dialog.
- Enter a name for the project and click the “Create” button.

- Make certain the project is the selected project in the Console. Look at the upper left corner. If the project is not displayed, click and select the project before continuing.

- Add access rights to the services you need (namely Gmail Service and Google Photos Library Service)
- Click on the “+ Enable APIs and services” button

- Search for Gmail using the Search box and click on “Gmail API”

- Click the “Enable” button to enable the Gmail API

- Return to the Google API Console, click the “+ Enable APIs and services” button, search for Photos, and click on “Google Photos Library API”

- Click the “Enable” button to enable the Google Photos Library API

- Return to the Google API Console and select “Credentials” on the left menu.
- Click the “+ Create credentials” button on the top and select “OAuth client ID”

- If you are prompted to “Configure consent screen”, do that, then return to the next step.
NOTE: The values entered are not important as you will be the only one authenticating to the app.- App Information
- App Name: Only you will see this.
- User support email: Enter a valid email.
- Audience
- External is the only option available
- Contact Information
- Enter a valid email
- Finish
- Check the checkbox and click the create button
- App Information
- Select the “Desktop app” for Application type, enter a name, and click the “Create” button.

- Copy the Client ID, Client secret, and Download JSON. Keep the information in a safe place.

- Back to the Credentials, click on the OAuth Client ID that you created.
- Select “Audience” from the left panel, and click the “Publish app” button.

- Click on the “Confirm” link to publish the app.

Get the Code
- Grab the code from GitHub
wget -P ~/ https://github.com/richteel/Photobooth/archive/refs/heads/main.zip
unzip ~/main.zip
mv ~/Photobooth-main ~/pb
mv ~/pb/home/pi/TouchSelfie ~/
mv ~/pb/home/pi/Desktop/Photobooth.desktop ~/Desktop/Photobooth.desktop
mv ~/pb/home/pi/.config/autostart ~/.config/
mv ~/pb/home/pi/*.sh ~/
mv ~/pb/home/pi/*.py ~/
# Clean up empty folders & zip file
rm -r ~/pb/home
rm ~/main.zip
# Make BASH scripts and desktop files executable
chmod +x ~/*.sh
chmod +x ~/TouchSelfie/*.sh
chmod +x ~/Desktop/*.desktop
chmod +x ~/.config/autostart/*.desktop
# cd ~/TouchSelfie
# ./setup.sh
Disable On-Screen Keyboard (Optional)
This step is optional but highly recommended as the on-screen keyboard takes up a significant amount of available screen space, making it difficult to navigate and see the screen. This is especially true with the original Raspberry Pi Touch Screen.
- We will turn off the on-screen keyboard to get it out of the way.

- Go to the Start Menu and select Preferences > Raspberry Pi Configuration.

- Go to the Display Tab, then select “Disabled” from the On-screen Keyboard option.

- Click the “OK” button.
- When prompted to reboot, select “Yes”

- When the Raspberry Pi reboot, the Photobooth application should be running.

- Press <ctrl> + q to exit the application and click the “Yes” button on the dialog.

Authenticate to the Google APIs
- Copy the JSON file that was downloaded from the Google API Console and rename it to “google_client_id.json”.
- If you did not download it, go to the Google API Console, go to Credentials, then click on the Client Id (link).

- You may transfer the JSON file to the Raspberry Pi using an application such as WinSCP or other method and place it in the /home/pi/TouchSelfie/scripts/ folder.
- If you did not download it, go to the Google API Console, go to Credentials, then click on the Client Id (link).
- Copy the “google_client_id.json” file to “OpenSelfie.json”. You may copy it by running the following command in the terminal.
cp ~/TouchSelfie/scripts/google_client_id.json ~/TouchSelfie/scripts/OpenSelfie.json
NOTE: There should be two JSON files in the scripts folder, google_client_id.json and OpenSelfie.json. - On the Raspberry Pi, open a terminal and type the following commands to run the setup application.
cd TouchSelfie
./setup.sh
- The “TouchSelfie – Options” window opens. Select the options you wish to enable, then click the “Next” button.
NOTES:
– It is recommended NOT to enable the software keyboard if using the Raspberry Pi touchscreen as screen resolution is too small.
– Image Effects is not implemented at this time so enabling it has no impact.
- The “TouchSelfie – Credentials” window opens. Click the “Get AppID” button.

- The “TouchSelfie – Credentials” second window opens. Click the “Launch browser” button.

- The browser will open prompting you to log into Google.
- Enter your Google Account and click the “Next” button.

- Enter your account password and click the “Next” button.

- If you have 2-step verification setup, then complete the 2-step verification process.
- You will see a page stating that Google hasn’t verified this app. Click the “Advanced” link at the bottom of the page.

- Click on the “Go to … (unsafe)” link at the bottom of the page.

- Check the “Select all” checkbox to select all the permissions, then click the “Continue” button.

- The browser window will state “The authentication flow has completed” and the TouchSelfie – Options screen will be displayed.
NOTE: There is a new file in the /TouchSelfie/scripts/ folder named, google_credentials.dat.
- Modify any options if necessary and click the “Next” button.
- Enter the Google Account, verify that the Credentials have green checkmarks, and click the “Next” button.
- Enter an email address that you can check and change any items you wish for the test email. Click the “Send test email to test the Gmail API connection. Check your email for the test message, then click the “Next” button.


- The select Photo Album screen needs some work yet. The list must be navigated with the up/down keys on the keyboard and selection is done with the spacebar. This will be fixed in a future release. If you do not have an album, choose “<Create New>” and
clicktab to the “Select” button and press the spacebar. It will create a new album named “TouchSelfie” and add a small single colored small image to the album. Do not delete the image from the album unless you have uploaded another image. There must be an image in the album.
- Click the “Test Upload” button. You may go out to Google Photos to verify that the album has been created and the image was uploaded.


- If necessary, modify the options for snapshots, then click the “Save” button.

- You may now close the terminal window and browser.
Customizing the frames for the photos and collages
The \TouchSelfie\logos\ folder has the frames that are applied over the photos.
- Single Photo: single_logo.png
- 4 Collage Photo: collage_four_square_logo.png
- 9 Collage Photo: collage_nine_square_logo.png
There is a Frames.svg that may be used for creating or updating the photos. The folder also contains some examples from various events.
Configuration File Settings
The configuration file is in the /TouchSelfie/scripts/ folder and is named, configuration.json. It is a JSON file with several options.
- archive_to_all_usb_drives
- Type: boolean
- Values: true or false
- Allows archiving of photos to a USB drive if one is attached to the Raspberry Pi
- NOTE: This functionality is not behaving properly. Some photos are archived but not all. All are written to the SD card though. This will be fixed in a later release.
- cameraMake
- Type: string
- A quoted string value indicating the make of the camera. You may set this to any value you wish. The value is written to the image Exchangeable Image File Format (EXIF) data.
- cameraModel
- Type: string
- A quoted string value indicating the model of the camera. You may set this to any value you wish. The value is written to the image EXIF data.
- countdown_before_snap
- Type: integer
- The seconds between button press and taking the photo. There needs to be images in the /TouchSelfie/scripts/resources/ folder to support the count. Currently there are 5 images named count_down _1.png to count_down _5.png. The images are 128×128 pixels in size.
- countdown_inter_snap
- Type integer
- The seconds between taking photos for collage images
- email_body
- Type: string
- A quoted string value for the body of the emails being sent from the application.
- email_subject
- Type: string
- A quoted string value for the subject of the emails being sent from the application.
- enable_effects
- Type: boolean
- Values: true or false
- Indicates if the effects button will be shown.
- enable_email
- Type: boolean
- Values: true or false
- Indicates if the mail button will be shown.
- enable_email_logging
- Type: boolean
- Values: true or false
- Indicates if emails will be logged to a file.
- enable_hardware_buttons
- Type: boolean
- Values: true or false
- Indicates if hardware buttons are available for application functions. Hardware buttons are not supported at this time.
- enable_print
- Type: boolean
- Values: true or false
- Indicates if the print button will be shown
- enable_upload
- Type: boolean
- Values: true or false
- Indicates if photos will be uploaded to a Google Album
- full_screen
- Type: boolean
- Values: true or false
- This is deprecated and may be removed from future releases.
- gmail_user
- Type: string
- A quoted value for the Google Account email address.
- google_photo_album_id
- Type: string
- A quoted text value that is the id of the Google Album. It is a Globally Unique Identifier (GUID) that is inserted by the setup program.
- google_photo_album_name
- Type: string
- A quoted text value of the name of the Photo Album.
- imageArtist
- Type: string
- A quoted string for the name of the artist/photographer. You may set this to any value you wish. The value is written to the image EXIF data.
- imageComment
- Type: string
- A quoted string for the note or comment to be added to the EXIF data. You may set this to any value you wish. The value is written to the image EXIF data.
- imageDescription
- Type: string
- A quoted string for the description to be added to the EXIF data. You may set this to any value you wish. The value is written to the image EXIF data.
- imageKeyWords
- Type: string
- A quoted string for comma separated keywords to be added to the EXIF data. You may set this to any value you wish. The value is written to the image EXIF data.
- local_archive
- Type: boolean
- Values: true or false
- If true, photos are saved to the SD card in addition to being uploaded to the Google Album. Recommended to have this value set to true.
- local_archive_dir
- Type: string
- A quoted string with the path to the local archive folder.
- location_lat
- Type: float
- A quoted decimal value for the latitude. The value is written to the image EXIF data.
- location_long
- Type: float
- A quoted decimal value for the longitude. The value is written to the image EXIF data.
- logo_file
- selected_printer
- snap_caption
- software
- Type: string
- A quoted string for the software to be added to the EXIF data. You may set this to any value you wish. The value is written to the image EXIF data.
- test_email_address
- Type: string
- A quoted value for the test email address. This is only used in the setup.
(Optional) Stop Execution File dialog box
You may want to stop seeing the Execute File dialog when clicking on the Photobooth desktop icon. Below are the steps to stop displaying the dialog.
- Click on the File Manager at the top of the screen.

- From the menu, select Edit > Preferences

- With “General” selected on the left panel, check the “Don’t ask options on launch executable file” option.

- Close File Manager and click on the Photobooth icon on the desktop. The application will launch.
Next Steps
There are several things that need to be completed and some changes that plan to be made. Below is a list of those items.
- The code is looking for the client id in two different JSON files. Modify the code so only one copy of the JSON file is needed. The two JSON files are:
- google_client_id.json
- OpenSelfie.json
- Use connected GPS to geotag photos. Currently the configuration file has location_lat and location_long which are used to geotag photos, but that requires that the configuration file is updated when the photobooth is brought to a new location.
- Add text to the buttons to make it easier for users to know what each button is used for. An alternative may be to add an info button.
- Email photo(s) function. Would like the option to review and select photos to email.
- Add effects back into the application.
- Add support to print photos.
- Improve the UI to let people know when a photo will be taken for each image of the collage and animation. Not certain how to make this intuitive.
- Fix the issues with the setup application and add additional options.

4 replies on “Revisit Photobooth Project”
This is awesome. I’m editing the configs and noted that the template files are using the “logo” files even when the configuration.json has logos set to null.
Also, email tests during setup were successful and email is true in configuration.json but emails are not sent when pictures are taken.
Just attempting a from scratch install. ./setup.sh results in a ModuleNotFoundError: “No Module named ‘PIL’ setup.py line 30.
Stan, thanks for letting me know. I will take a look by setting up a clean install and provide an update.
I just went through the steps with a clean install and did not see the error. The only thing that I can think may have happened is in the “Update Raspbian and Install Packages” section, you may have missed installing PIL in the virtual environment. Can you go through those steps again to see that it is installed in the virtual environment? It does need to be installed twice. The steps have it being installed natively, outside of the virtual photobooth environment. It is then installed again in the virtual environment.
# Create virtual environment for gdata
python -m venv ~/photobooth
source ~/photobooth/bin/activate
# Install google data api and upgrade it
pip install gdata
pip install –upgrade google-api-python-client
pip install –upgrade oauth2client
# Install ImageTk, Image from PIL
# Appears we need to do this in the virtual environment too.
pip install pillow
# pip install numpy
# Leave the virtual environment
deactivate