This is a photobooth made in Node.js and the ws and express modules Features include:
- Support for foregrounds
- A pre-set foreground just for proof
- Live population and number-of-saved-images monitor
- Customizable capture delay timer
- Download page
- Add filters like contrast, brightness, and blur
- Photos (PNG format) stored as binary strings in memory as well as in .data/photos
- Easy server-side TUI for erasing captures and saving archives
To-do list:
- Automatic printing
Simply install Node.js and run these commands in your terminal.
git clone https://codeberg.org/Mimicoctopus1/photobooth
cd photobooth
npm install
npm run start # Alternatively, index.js has a shebang so you can double-click it from your file manager if you give yourself permissionThen, open up [your ip address]:8080.
See here to use other ports
Foregrounds are stored in public/assets as .png files. To make your own, follow these steps:
- Take a picture of the foreground, draw it on your computer, or get it in some way.
- Remove the background of the foreground so it is transparent. If you don't want to install anything, you can use tools online like remove.bg (note that the free version images are not high resolution, but they're not that bad).
- Make sure it is in
png,jpg, orwebpformat, or something else that is compatible with your average browser. Again, there are services online for this like CloudConvert. - Name the file. In the actual photobooth, any hypens ("-") will be replaced with spaces, and the first period (".") and anything after it will be removed.
- Put it in
public/assets.
Most CSS filters can be added in the download page. Some that were excluded are grayscale (because we have saturation) and url (because your average individual will be absolutely befuddled). Filters that are included:
- Color Inversion
- Blur
- Opacity
- Hue Rotation
- Brightness
- Contrast
- Saturation
- Sepia
You can make a .env file and add this:
PORT=<your port here>or run either of these:
npm run start -- --port <your port here>
PORT=<your port here> npm run startYou can make a .env file and add this:
SAVEFOLDER=<folder to use>or run either of these
npm run start -- --save-folder <folder to use>
npm run start -- -s <folder to use>
SAVEFOLDER=<folder to use> npm run startTo get a bunch of details, use the --verbose flag.
npm run start -- --verboseWhile the program is running, you can type in these commands directly into the terminal.
| Syntax | Effect |
|---|---|
population |
Tells you how many users are connected, including the actual device taking the pictures |
images |
Tells you how many images there are saved. |
delete |
Deletes all the images. |
delete { <start>-<end> | <amount>@<first> | <index> } [arg1] [arg2] ... [argN] |
Deletes based on the arguments in the list. The following all delete elements 6, 7, and 8.
|
backup[ file] |
Saves all the photos to the file specified. If not specified, to the default save file, only with an `.old` extension added. |
load[ file] |
Loads images from the file specified, or the default save file, only with an `.old` extension added. |
kick |
Kicks everybody off of the server. |