{"id":15197180,"url":"https://github.com/philipptrenz/photo-booth","last_synced_at":"2025-10-02T13:31:03.025Z","repository":{"id":45722629,"uuid":"71588477","full_name":"philipptrenz/photo-booth","owner":"philipptrenz","description":"A multi-platform photo booth software using Electron and your camera","archived":true,"fork":false,"pushed_at":"2021-03-30T07:46:20.000Z","size":16061,"stargazers_count":390,"open_issues_count":0,"forks_count":111,"subscribers_count":33,"default_branch":"master","last_synced_at":"2024-09-24T23:32:06.029Z","etag":null,"topics":["booth","box","camera","electron","gphoto2","photo","photobooth","photography","raspberrypi","wedding"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/philipptrenz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"philipptrenz","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2016-10-21T18:41:56.000Z","updated_at":"2024-09-22T13:49:11.000Z","dependencies_parsed_at":"2022-08-12T12:10:13.502Z","dependency_job_id":null,"html_url":"https://github.com/philipptrenz/photo-booth","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philipptrenz%2Fphoto-booth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philipptrenz%2Fphoto-booth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philipptrenz%2Fphoto-booth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philipptrenz%2Fphoto-booth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/philipptrenz","download_url":"https://codeload.github.com/philipptrenz/photo-booth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219875700,"owners_count":16554702,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["booth","box","camera","electron","gphoto2","photo","photobooth","photography","raspberrypi","wedding"],"created_at":"2024-09-28T00:44:09.938Z","updated_at":"2025-10-02T13:30:57.444Z","avatar_url":"https://github.com/philipptrenz.png","language":"JavaScript","funding_links":["https://ko-fi.com/philipptrenz"],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://img.shields.io/travis/philipptrenz/photo-booth.svg)](https://travis-ci.org/philipptrenz/photo-booth)\n[![npm version](https://badge.fury.io/js/%40philipptrenz%2Fphoto-booth.svg)](https://badge.fury.io/js/%40philipptrenz%2Fphoto-booth)\n\n# photo-booth\n\nA multi-platform photo booth software using Electron and your camera\n\n![photo booth image from The Verge](https://cdn.vox-cdn.com/thumbor/gkbHIytNYvEPwbLLVxmVuTA5cjM=/1600x0/filters:no_upscale()/cdn.vox-cdn.com/uploads/chorus_asset/file/9062729/akrales_170815_1889_0006.jpg)\n(Source: [The Verge](https://www.theverge.com/circuitbreaker/2017/8/24/16193418/diy-photo-booth-party-wedding-dlsr-camera-how-to-build-raspberry-pi), accessed 08 March 2018)\n\n## Important Note\n\n**This repository is no longer under active maintainance.**\n\n\n## How it works\n\nSimply connect your camera via USB or even via wifi to the computer running this application, for example a **Raspberry Pi**. The app shows a countdown by clicking at the screen (or tapping at a touchscreen), triggers your camera to take a photo, downloads it from your camera, shrinks it to a smaller size and displays it on the screen. First in fullscreen, then added to a gallery of previous taken photos.\n\nphoto-booth also provides a web application by running a webserver. Every newly taken photo gets immediately pushed to the webapp. From there it's easy for your guests to download their photos. There's also the option to leave a contact address for sending the photos afterwards. Creating GIF animations and printing out selected photos are also possible through the web application. You only have to provide a Wi-Fi hotspot and a printer (optional for printing feature).\n\nBecause of the use of `gphoto2` and `cups` it works with nearly any camera or printer like plug and play.\n\n## Installation\n\nTo clone and run this repository you'll need [Git](https://git-scm.com), [Node.js](https://nodejs.org/en/download/), [gphoto2](http://gphoto.sourceforge.net/) and [CUPS](https://www.cups.org/) installed.\n\nBefore getting started please check [here](#Unsupported-devices) if the hardware you want to use is supported. I tested photo-booth under Ubuntu Linux (64bit), MacOS and Raspbian (Raspberry Pi 3, ARM). Anyway, the documentation here will be focused on Linux based systems.\n\nAlso check [here](http://www.gphoto.org/proj/libgphoto2/support.php) if your camera is supported (at least *Image Capture* should be available). Please also note, that only the JPEG-mode of your camera is currently supported (no RAW or RAW+JPEG).\n\n**Raspbian STRETCH (with desktop):**\n\n```bash\n# Install needed dependencies\nsudo apt update\nsudo apt install git libxss-dev libgconf-2-4 libnss3\n\n# Install latest version of libgphoto2, choose last stable release\nwget https://raw.githubusercontent.com/gonzalo/gphoto2-updater/master/gphoto2-updater.sh \u0026\u0026 sudo bash gphoto2-updater.sh\n\n# If you are using a Raspberry Pi \u003e 1: Activate hardware acceleration\nsudo apt install libgl1-mesa-dri\nsudo su -c 'grep -q -F \"dtoverlay=vc4-kms-v3d\" /boot/config.txt || echo \"dtoverlay=vc4-kms-v3d\" \u003e\u003e /boot/config.txt'\n\n# Clone the repository\ngit clone https://github.com/philipptrenz/photo-booth.git \u0026\u0026 cd photo-booth\n\n# Make the Node installation script executable\nsudo chmod +x ./scripts/install_node_v9.sh\n\n# Install node\nsudo ./scripts/install_node_v9.sh\n\n# Install (you can do this later if you want to add a printer to use the printing feature)\nnpm install\n```\n\n## Run photo-booth\n\nTo run photo-booth the following command should do it. To run the webapp on port 80 and for the usage of GPIO pins at the Raspberry Pi root privileges are required.\n\n**WORKAROUND FOR RASPBERRY PI 3 if Photo-Booth stays black**\n\n```\nexport LD_PRELOAD=node_modules/sharp/vendor/lib/libz.so\n```\n\n**Important:** The command needs to be run from a terminal on the GUI, executing via SSH will most likely fail!\n\n```\nsudo npm start\n```\n\nBasically, it's not a good idea to run a web server as root, if you do not need GPIOs consider setting up a redirect from port 80 to 8080 on your system. That can be achieved by a iptables rule for example. Then you can start photo-booth with\n\n```\nnpm start\n```\n\n**HINT:** The little linux tool `unclutter` can hide the cursor.\n\n## Start photo-booth on boot (for Raspberry Pi)\n\nTo start photo-booth on boot add the following line at the end of `/home/pi/.config/lxsession/LXDE-pi/autostart`:\n\n```\n@sudo node /home/pi/photo-booth/scripts/cli.js\n```\n\n\n## Configure it\n\nThere are a few settings and options that you should take a look at.\n\n\n### The `config.json`\n\nThe project includes a config.json file. There you can set several parameters, e.g. to start in fullscreen or not or if you want to keep your taken photos on your camera.\n\nIt looks like this:\n\n```json\n{\n\t\"language\": \"en\",\n\t\"init\": {\n\t\t\"fullscreen\": true,\n\t\t\"width\": \"1440\",\n\t\t\"height\": \"900\",\n\t\t\"showDevTools\": false,\n\t\t\"useGPIO\": false,\n\t\t\"grayscaleMode\": true,\n\t\t\"preventScreensaver\": false\n\t},\n\t\"maxImageSize\": 1500,\n\t\"countdownLength\": 5,\n\t\"slideshow\": {\n\t\t\"enabled\": true,\n\t\t\"activatesAfterSeconds\": 30,\n\t\t\"secondsPerImages\": 8\n\t},\n\t\"gphoto2\": {\n\t\t\"capturetarget\": 1,\n\t\t\"keep\": true,\n\t\t\"simulate\": false\n\t},\n\t\"content_dir\": null,\n\t\"webapp\": {\n\t\t\"password\": \"test\",\n\t\t\"maxDownloadImageSize\": 800,\n\t\t\"gifDelay\": 1000,\n\t\t\"enableRemoteRelease\": true,\n\t\t\"contactAddressType\": \"email\"\n\t},\n\t\"printing\": {\n\t\t\"enabled\": false,\n\t\t\"simulate\": false,\n\t\t\"printer\": \"printer-name\",\n\t\t\"limitPerUser\": 0,\n\t\t\"overlay\": {\n\t\t\t\"image\": \"overlay.png\",\n\t\t\t\"x\": \"right\",\n\t\t\t\"y\": \"bottom\"\n\t\t},\n\t\t\"grayscale\": true,\n\t\t\"layouts\": []\n\t},\n\t\"live\": {\n\t\t\"framerate\": 10\n\t},\n\t\"branding\": {\n\t\t\"type\": \"text\",\n\t\t\"content\": \"\u003cdiv style='font-size: 1.2em; padding-left: 25px;'\u003e\u003ci class='fa fa-wifi' aria-hidden='true' style='font-size: 2.5em;'\u003e\u003c/i\u003e \u003cb style='font-size: 2em; padding-left: 15px;'\u003ephoto-booth\u003c/b\u003e\u003cbr /\u003e\u003cp\u003eLog into wifi, browse to \u003cb style='padding: 0 5px;'\u003ephoto.app\u003c/b\u003e and download your photos!\u003c/p\u003e\u003c/div\u003e\",\n\t\t\"position\": \"bottomleft\"\n\t},\n\t\"flash\": {\n\t  \"enabled\": true\n\t}\n}\n```\n\nBest way to modify the `config.json` is by copying it to `my.config.json`, photo-booth will prefer the latter one:\n```\ncp config.json my.config.json\n```\n\n\nSome notes:\n\n* Images get shrinked after got downloaded from the camera, set the size with maxImageWidth\n* You have to figure out the captureTarget of your camera. Even if you choose to keep images at the camera, if gphoto2 chooses to store by default to the RAM of your camera, images get deleted when camera get turned off. Figure out the right captureTarget by running `gphoto2 --get-config=capturetarget`, then choose something should named sd card or so. This should be your first try if a photo gets taken, but it won't show up at the screen.\n* If you want to keep images on camera, set `keep` to `true`\n* The errorMessage is pure HTML, just fill in whatever you want\n* Slideshow and liveview do not work together.\n* You have to experiment with the framerate for live preview depending on the power of your machine. On a Notebook with an Intel i7-8550U upto 15% CPU utilization are needed for 20 frames per second. Also if your camera is running on battery, it drastically decreases the battery duration.\n* When ``flash`` is set to `enabled` a white  page  will be shown as a flash after completing the countdown\n* You can use `gphoto2.simulate = true` when you want to test your setup without an active camera connection\n* The `webapp.contactAddressType` defines what kind of address types are supported inside the webapp. Supported values are `none` (feature disabled), `email` (email validation) and `text` (no input validation).\n\n### How to use the integrated webapp\n\nAs mentioned above photo-booth has a built in web page where images can be downloaded, gif animations can be created and images can be printed.\n\nFor an easy way to use it, start a open wifi hotspot on the computer photo-booth runs on. If you use a Raspberry Pi, there're enough tutorials out there to figure it out (i.e. [here](https://www.raspberrypi.org/documentation/configuration/wireless/access-point.md)). Then connect your device, e.g. a smartphone, with the wifi, open your browser and type in the ip address of the Pi. More elegant is it to configure a DNS redirect so the users can type in a web address like \"photo.app\", therefore I use `dnsmasq` which is also configured as DHCP server.\n\n## Use a push button to trigger photos\n\nYou can connect a physical push button to the GPIO Pins of your Pi to trigger photos!\n\nTherefore activate the GPIOs by setting `\"useGPIO\": true` in config.json. Then connect the first port of the push button to the ground pin of your Pi, second to GPIO 3 (PIN 5) and to a resistor of about 10k-100kΩ, the other end of the resistor to 3.3V (e.g. PIN 1). That's all!\n\n**Make sure you run the application as root (`sudo npm start`), GPIOs need root privileges.**\n\n```\n _______RASPBERRY PI_______\n                          |\n          |----3.3V---●o  |\n ~50kΩ →  ▯           oo  |\n          |----GPIO3--●o  |\n      [-\\             oo  |\n         \\------GND---●o  |\n                      oo  |\n                      oo  |\n                      oo  |\n                      oo  |\n                      oo  |\n                      oo  |\n                      oo  |\n                      oo  |\n                          |\n                          |\n```\n\n## Install a printer\n*photo-booth* also supports image printing with configurable layouts.\nFor this feature to work you need a supported printer, install additional software and configure the layouts individually.\n\n### Install printer software\n1. Connect and power on the printer\n2. Run the following scripts:\n\t```bash\n\tsudo apt-get update\n\n\t# Install additional libraries for collage creation\n\tsudo apt-get install libpixman-1-dev\n\tsudo apt-get install libcairo2-dev libjpeg-dev libgif-dev\n\tsudo apt-get install libpango1.0-dev\n\n\t# Install cups\n\tsudo apt-get install cups\n\n\t# Install cups-config (needed for node-printer)\n\tsudo apt-get install libcups2-dev\n\n\t# Change user (adjust pi, if you have changed this)\n\tsudo usermod -a -G lpadmin pi\n\n\t# Install optional node modules\n\tcd photo-booth\n\tnpm install\n\n\tcd helpers/collage\n\tnpm install\n\t```\n3. Navigate to http://localhost:631 and add the new printer\n\t- **Important**: Remember the name, you need it for the configuration file later\n4. Check if the printer is enabled and is accepting jobs. This can be done using the UI or with the following commands:\n\t```bash\n\t# Check state\n\tlpstat -p\n\n\t# Enable if the printer is disabled\n\tcupsenable printer-name\n\t```\n### Configure the application\n- Configure the content in `config.json` (or `my.config.json`) under the section `printing`\n- Set `enabled` to `true`\n- Set `simulate` to `true` if you only want to test the image generation\n- Set `printer` to the printer name you configured during the installation process\n- Set `limitPerUser` if you want to limit the printouts per person. 0 means no limit and with the webapp password you always have unlimited printouts.\n- Use `grayscale` if you want to print only grayscale images (seperate config only for printing feature) - **Warning**: The grayscale feature does not work for larger DPI values.\n- Use `overlay` to add a image to each printout. Be sure that it matches all your layouts (eg. 2x2 layout with spacing won't match with an overlay in the same color as the background color) and also consider that not all placehoders must be occupied (eg. do not use the background color in the overlay image)\n- Configure the layouts under `layouts`. You can add multiple layouts (the user can select the desired layout from within the web application). A sample layout looks like this:\n\t```json\n\t{\n\t\t\"key\": \"selphy_2x2\",\n\t\t\"options\": {\n\t\t\t\"dpi\": 300,\n\t\t\t\"width\": 2,\n\t\t\t\"height\": 2,\n\t\t\t\"imageWidth\": 868,\n\t\t\t\"imageHeight\": 577,\n\t\t\t\"backgroundColor\": \"#ffffff\",\n\t\t\t\"spacing\": {\n\t\t\t\t\"top\": 8,\n\t\t\t\t\"left\": 0,\n\t\t\t\t\"bottom\": 8,\n\t\t\t\t\"right\": 1,\n\t\t\t\t\"betweenImages\": 11\n\t\t\t}\n\t\t}\n\t}\n\t```\n  - This sample layout is a 2x2 layout optimized for the following configuration:\n    - *Canon Selphy CP1300* printer with a paper size of `100 x 148 mm` and a resolution of `300 x 300dpi` (eg. `1181 x 1748 px`)\n\t- *Nikon D90* camera with a picture size of `4288x2848` which results in a width to height factor of `1.5056...`\n  - Description of the options:\n\t- *key*: Internal identifier for the layout. Must not contain invalid file name characters\n\t- *dpi*: The printer resolution\n\t\t- *Note*: Must not match the full printer DPI (images will be scaled to the whole printing area)\n\t\t- Defaults to `96`, which should already be quiet good for most portable low quality printers\n\t\t- **Warning**: Higher DPI values require more resources, which can be too much for a small computer like a Raspberry PI. Also the grayscale function does not work at higher resolutions anymore.\n\t- *width* and *height*: Number of images per row / column\n\t- *imageWidth* and *imageHeight*: The width / height of each individual image in the layout.\n\t  Try to set the values in a way that it will give the same aspect ration as the original image size from the camera.\n\t- *backgroundColor*: Layout background color which is used to fill the spacing, the unused space when the original images do not have the same aspect ratio or placeholders without an image.\n\t- *spacing*: Spacing outside the images (`top`, `left`, `bottom` and `right`) and between two individual images (`betweenImages`).\n\n## Unsupported devices\n\nPlease note that there are several devices which are not supported by photo-booth.\n\n### Unsupported architectures\n\nAs Electron, the main framework, besides ia32 (i686) and x64 (amd64) only supports the ARM v7 architecture (and ARM v8 as it is backwards compatible), several ARM devices are not supported. Further information can be found [here](https://electronjs.org/docs/tutorial/support#linux). The following ARM devices among others can not be supported:\n\n* Raspberry Pi Zero\n* Raspberry Pi Zero W / WH\n* Raspberry Pi 1 A / A+\n* Raspberry Pi 1 B / B+\n\n### Unsupported cameras\n\n* The Raspberry Pi camera module is not supported\n* Webcams (such as those built into your laptop or Logitech USB) are not supported\n\nAlso some other DSLR and Compact Cameras are not supported. Please check for your specific model [here](http://gphoto.org/proj/libgphoto2/support.php).\n\n## Common issues\n\nIf you have any problems, start reading here. If you do not find anything, check under [Issues](https://github.com/philipptrenz/photo-booth/issues), if someone else already had a similar problem. If you still have no solution, open a new issue.\n\n### How to quit photo-booth in fullscreen?\n\nHit the Escape key to exit the fullscreen mode, then you can close the app.\n\n### Why are all images in grayscale?\n\nGo to `config.json` and change `grayscaleMode` to `false`.\n\n### My camera takes a photo, but it does not show up\n\nThis may be related to wrong capture target settings. Run `gphoto2 --get-config capturetarget` from the console, the output looks something like this:\n\n```\nLabel: Capture Target\nType: RADIO\nCurrent: Internal RAM\nChoice: 0 Memory card\nChoice: 1 Internal RAM\n\n```\nIdentify the number of the memory card and change the `captureTarget` property in `config.json`.\n\n### error (-53 'could not claim the usb device')\n\nIt seems to be an old known problem with gvfs-gphoto2-volume-monitor module. For reference [read here](https://github.com/raspberrypi/linux/issues/218#issuecomment-38143613).\n\n```\nsudo rm /usr/share/dbus-1/services/org.gtk.vfs.GPhoto2VolumeMonitor.service\nsudo rm /usr/share/gvfs/mounts/gphoto2.mount\nsudo rm /usr/share/gvfs/remote-volume-monitors/gphoto2.monitor\nsudo rm /usr/lib/gvfs/gvfs-gphoto2-volume-monitor\n```\n\n## Contributors\n\n* [wikijm](https://github.com/wikijm)\n* [blak3r](https://github.com/blak3r)\n* [probststefan](https://github.com/probststefan)\n* [jgoestl](https://github.com/jgoestl)\n* [lal12](https://github.com/lal12)\n* [blaueQuelle](https://github.com/blaueQuelle)\n* [andi34](https://github.com/andi34)\n* [vangod90](https://github.com/vangod90)\n\n## Mentions\n\nThe project got featured at **[The Verge](https://www.theverge.com/circuitbreaker/2017/8/24/16193418/diy-photo-booth-party-wedding-dlsr-camera-how-to-build-raspberry-pi)**, incredible!\nAlso take a look at the video they made at **[Facebook](https://www.facebook.com/circuitbreaker/videos/1839861396306681/)!**\n\nAn article was also published in the **[blog of my degree course](http://www.medieninformatik.de/projekt-photo-booth-amerikaner-berichten/)** (in German).\n\n[partyblitzer](https://github.com/partyblitzer) published a [post on his blog](http://tobias-senff.de/partyblitzer/) and a [video on YouTube](https://www.youtube.com/watch?v=ujMKFKPHP8k) using this software for his DIY photo booth setup.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilipptrenz%2Fphoto-booth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphilipptrenz%2Fphoto-booth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilipptrenz%2Fphoto-booth/lists"}