Paint in mid-air using hand gestures — your webcam tracks your hand and you draw on a virtual canvas by just pointing your finger. No extra hardware needed.
Uses MediaPipe for real-time hand tracking and a simple gesture classifier on top:
| Gesture | What it does |
|---|---|
| ☝ Point (index finger) | Draw — fingertip leaves a trail |
| ✊ Fist | Pause — lifts the pen |
| 🤏 Pinch (thumb + index) | Switch to next color |
Everything is composited live onto the camera feed.
You need Python 3.10+ and a webcam.
git clone https://github.com/trexdevelop/air-paint.git
cd air-paint
pip install -r requirements.txt
python main.pyThe MediaPipe hand model (~10 MB) downloads automatically on first launch.
| Key | Action |
|---|---|
1–8 |
Pick color directly |
C |
Clear canvas |
S |
Save current frame as PNG |
+ / - |
Brush size up/down |
Q / ESC |
Quit |
Red · Orange · Yellow · Green · Blue · Purple · Pink · White
Switch with pinch gesture or keys 1–8.
main.py – entry point, camera loop
config.py – colors, constants, settings
gestures.py – gesture classification logic
overlay.py – UI rendering (palette, status bar, cursor)
MIT