pixlet is a gesture-controlled webcam photobooth built with Python, OpenCV, and MediaPipe.
Use your hands to select visual filters, pose for the camera, and take photos without touching your computer. Pixlet performs real-time hand and face tracking to turn simple gestures into camera controls and applies effects directly to the live video stream.
- Real-time hand tracking using MediaPipe
- Real-time face tracking using MediaPipe Face Mesh
- Gesture-controlled filter selection
- Gesture-controlled photo capture
- 7 visual filters
- Photo preview after capture
- Automatic local photo storage
- Live webcam preview
Pixlet currently supports seven filters (using ASL numbering):
| Gesture | Filter |
|---|---|
| One | Black & White |
| Two | Pikachu |
| Three | Pixelated |
| Four | Chiikawa |
| Five | Pink |
| Six | K-Pop Idol |
| Seven | Fruit |
The filters include both traditional image processing and dynamically positioned image overlays. Face-based filters use facial landmarks to determine where and how large an overlay should be rendered.
1. Black & White
- Converts the camera frame to grayscale.
2. Pikachu
- Detects the user's face.
- Uses forehead landmarks to determine the position and scale of Pikachu ears.
- Adds a Pikachu image overlay to the frame.
3. Pixelated
- Downscales the camera frame to
128 × 64. - Upscales it back to the original resolution using nearest-neighbor interpolation to create a pixel-art effect.
4. Chiikawa
- Detects the user's forehead.
- Randomly selects one of several Chiikawa characters when the filter changes.
- Dynamically scales and positions the character based on the user's face.
5. Pink
- Adjusts the red channel of the image to create a pink-tinted effect.
K-Pop
- Randomly selects from several K-Pop artist overlays.
Fruit
- Detects the user's face and places a randomly selected fruit/food overlay around the face.
Pixlet uses MediaPipe hand landmarks to interpret finger configurations as commands.
The left hand controls the active filter. Finger positions are analyzed to identify different gestures, which map to filter IDs.
The right hand controls photo capture.
To take a photo:
- Open your right hand.
- Make a pinch gesture with your thumb and index finger.
- Hold the gesture briefly.
- Pixlet starts a 3-second countdown.
- The processed frame is captured and saved.
Pixlet processes every frame through a real-time computer vision pipeline:
Webcam
│
▼
OpenCV Frame Capture
│
├───────────────┐
▼ ▼
Hand Tracking Face Tracking
(MediaPipe) (MediaPipe)
│ │
▼ ▼
Gesture Facial
Recognition Landmarks
│ │
└───────┬───────┘
▼
Filter Selection
│
▼
Filter Pipeline
│
▼
Live Preview
│
▼
Gesture Capture
│
▼
Countdown + Flash
│
▼
Saved Photo
The main loop continuously captures frames, mirrors the webcam feed, runs hand and face tracking, determines the current filter, applies the filter, and displays the resulting frame.
- Python
- OpenCV — webcam capture, image processing, rendering, and photo storage
- MediaPipe Hands — real-time hand landmark detection and gesture recognition
- MediaPipe Face Mesh — facial landmark detection for positioning visual effects
- NumPy — image and pixel manipulation
pixlet/
├── main.py # Main camera loop and application logic
├── Camera.py # Camera state, countdown, capture, flash, and preview
├── Hand_Tracker.py # MediaPipe hand tracking
├── Face_Tracker.py # MediaPipe face tracking
├── Gestures.py # Hand gesture recognition
├── Filters.py # Image filters and visual overlays
│
├── filters/
│ ├── pikachu/
│ ├── chiikawa/
│ ├── kpop/
│ └── fruits/
│
├── unedited_filters/ # Original filter assets
└── pixs/ # Captured photos
- Python 3
- A webcam
- OpenCV
- MediaPipe
- NumPy
Install the Python dependencies:
pip install opencv-python mediapipe numpyClone the repository and run:
python main.pyPixlet will open the webcam and display the live filtered preview.
Press Esc to exit.
Captured photos are automatically saved to the pixs/ directory.
Each photo is saved using a timestamp-based filename:
pixs/pixlet_<timestamp>.png
After taking a photo, Pixlet displays a temporary preview thumbnail in the bottom-right corner of the camera feed and produces a short flash effect.
Pixlet separates the camera application into several components:
Coordinates the entire application:
- Captures webcam frames
- Runs hand and face tracking
- Interprets gestures
- Selects filters
- Applies visual effects
- Handles photo capture
- Displays the final frame
Wraps MediaPipe Hands and exposes functionality for:
- Detecting up to two hands
- Tracking hand landmarks
- Identifying handedness
- Drawing hand landmarks for debugging
Uses MediaPipe Face Mesh to track a single face with refined landmarks, providing the coordinates required for face-aware filters.
Converts MediaPipe hand landmarks into higher-level gestures such as:
- Finger counting
- Pinching
- Thumb positions
- Filter selection gestures
Contains the image-processing pipeline and filter implementations.
It supports both pixel-level transformations, such as grayscale and pixelation, and alpha-blended PNG overlays that are dynamically scaled and positioned using facial landmarks.
Manages camera-specific state and effects, including:
- Capture cooldowns
- Countdown timer
- Photo saving
- Flash animation
- Post-capture preview
Pixlet was built to make taking photos feel more like using a physical photobooth: no keyboard or mouse required.
Computer vision handles the interaction layer, allowing users to control the camera entirely through natural hand gestures while face tracking makes the visual effects responsive to the user's position.
Potential improvements include:
- Adding more filters and gestures
- Multiple face support
- Improved gesture robustness
- Filter previews before selection
- Photo gallery functionality