A simple, customizable web-based photo booth application built with Flask and OpenCV. Perfect for parties, events, weddings, or any occasion where you want to capture fun memories!
- Multi-Photo Sessions: Takes 3 photos per session with a clear countdown
- DroidCam Integration: Uses Android phone as wireless camera via DroidCam
- Email Integration: Automatically emails photos to users
- Photo Gallery: Browse all captured photos in a slideshow format
- Fullscreen Slideshow: Auto-playing slideshow with keyboard controls
- Easy Customization: Simple configuration file for personalizing text, colors, and images
- Photo Archiving: All photos are automatically organized by session
- Responsive Design: Works on desktop, tablet, and mobile devices
-
Install Dependencies:
pip install -r requirements.txt
-
Set up Gmail for email features (optional):
export GMAIL_USER="your_email@gmail.com" export GMAIL_PASS="your_app_password"
Get an app password from: https://myaccount.google.com/apppasswords
-
Run the Application:
python app.py
-
Open in Browser: Navigate to
http://localhost:5000
This photo booth application requires an Android phone with DroidCam to function as the camera source.
- Android phone with the DroidCam app installed
- Computer with DroidCam client application installed and running
- Both devices connected to the same network (Wi-Fi) or via USB
-
Install DroidCam on Android:
- Download "DroidCam" from Google Play Store
- Open the app and note the IP address and port shown
-
Install DroidCam Client on Computer:
- Windows/Mac: Download from DroidCam website
- Linux: Install via package manager or download from website
# Ubuntu/Debian example sudo apt install droidcam
-
Connect DroidCam:
- Open DroidCam client on your computer
- Enter the IP address and port from your Android phone
- Click "Connect" - you should see the phone's camera feed
- Important: Keep DroidCam client running while using the photo booth
-
Verify Camera Access:
- The photo booth will automatically detect the DroidCam virtual camera
- If you have multiple cameras, it will use the first available one
- Position your Android phone to get the best angle for photos
- Ensure both devices are on the same Wi-Fi network
- Check that DroidCam client is connected and showing video feed
- Restart DroidCam client if the connection is lost
- Make sure no other applications are using the camera
The easiest way to customize your photo booth is by editing the config.json
file:
{
"event": {
"title": "Photo Booth",
"subtitle": "Capture Your Memories!",
"welcome_message": "Take some fun photos to remember this special moment!",
"button_text": "Take Photos! πΈ",
"slideshow_text": "View Photo Gallery π¬",
"email_subject": "Your Photo Booth Pictures!",
"email_message": "Thanks for using our photo booth! Here are your awesome pictures to remember this special moment! πΈβ¨"
},
"styling": {
"primary_color": "#2196F3",
"background_color": "#f5f5f5",
"confetti_emojis": "πΈ π β¨ π π π·"
},
"images": {
"main_image": "default_photo_booth.jpg",
"main_image_alt": "Photo Booth"
}
}
- title: Main heading shown on the home page
- subtitle: Secondary text under the title
- welcome_message: Instructions/welcome text for users
- button_text: Text on the main action button
- email_subject: Subject line for emailed photos
- email_message: Message body for emailed photos
- primary_color: Main theme color (hex code)
- background_color: Page background color (hex code)
- confetti_emojis: Decorative emojis displayed on pages
- main_image: Filename of the main display image (must be in
static/images/
) - main_image_alt: Alt text for the main image
-
Main Display Image:
- Add your custom image to
static/images/
- Update
config.json
to reference your image:"images": { "main_image": "your_custom_image.jpg", "main_image_alt": "Your Custom Description" }
- Add your custom image to
-
Creating Custom Images:
- Recommended size: 400x300 pixels
- Supported formats: JPG, PNG, GIF
- Use the provided
create_default_image.py
as a template for generating placeholder images
Here are some pre-made color combinations you can use:
Wedding Theme:
"primary_color": "#d4af37",
"background_color": "#fefefe",
"confetti_emojis": "π π π β¨ π π"
Birthday Theme:
"primary_color": "#ff6b6b",
"background_color": "#fff0f5",
"confetti_emojis": "π π π π π π₯³"
Corporate Event:
"primary_color": "#2c3e50",
"background_color": "#ecf0f1",
"confetti_emojis": "πΈ β¨ π― π πͺ π"
For more advanced customization, you can edit the HTML templates in the templates/
directory:
index.html
: Home page layoutshow_photos.html
: Photo display pageslideshow.html
: Gallery viewfullscreen_slideshow.html
: Fullscreen slideshow
The main stylesheet is static/party.css
. You can add custom CSS rules here or modify existing ones.
photo-booth/
βββ app.py # Main Flask application
βββ config.json # Configuration file
βββ requirements.txt # Python dependencies
βββ README.md # This file
βββ static/
β βββ images/ # Display images
β βββ photos/ # Current session photos
β βββ party_archive/ # Archived photos by session
β βββ party.css # Stylesheet
βββ templates/ # HTML templates
βββ index.html
βββ show_photos.html
βββ slideshow.html
βββ fullscreen_slideshow.html
{
"event": {
"title": "Sarah & Mike's Wedding",
"subtitle": "Capture Our Special Day!",
"welcome_message": "Help us celebrate by taking some fun wedding photos!",
"button_text": "Take Wedding Photos! π",
"slideshow_text": "View Wedding Gallery π",
"email_subject": "Photos from Sarah & Mike's Wedding!",
"email_message": "Thank you for celebrating with us! Here are your wonderful photos from our special day! ππ"
},
"styling": {
"primary_color": "#d4af37",
"background_color": "#fefefe",
"confetti_emojis": "π π π β¨ π π"
}
}
{
"event": {
"title": "Company Annual Meeting",
"subtitle": "Capture the Moment!",
"welcome_message": "Take professional photos to remember this event!",
"button_text": "Take Photos! πΈ",
"slideshow_text": "View Event Gallery π¬",
"email_subject": "Your Photos from the Company Event",
"email_message": "Thanks for attending our company event! Here are your photos from today."
},
"styling": {
"primary_color": "#2c3e50",
"background_color": "#ecf0f1",
"confetti_emojis": "πΈ β¨ π― π πͺ π"
}
}
- Ensure your camera is connected and not being used by other applications
- Try different camera indices in the code (0, 1, 2) if the default doesn't work
- On Linux, you may need to add your user to the
video
group
- Make sure you're using an "App Password" from Google, not your regular password
- Enable 2-factor authentication on your Google account first
- Check that the environment variables are set correctly
- The slideshow limits to 200 photos maximum for performance
- Large images are automatically resized during capture
- Consider clearing old archived photos periodically
- Python 3.7+
- Android phone with DroidCam app installed
- Computer with DroidCam client application
- Modern web browser
- Linux/Mac/Windows support
- Flask: Web framework
- OpenCV: Camera and image processing
- NumPy: Image array operations
- PyAutoGUI: Screen interaction (for preview window)
- DroidCam: Android app + computer client for camera functionality
This project is open source. Feel free to modify and distribute according to your needs.
Contributions are welcome! Please feel free to submit pull requests or open issues for bugs and feature requests.