Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Air Paint 🎨

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.

How it works

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.

Setup

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.py

The MediaPipe hand model (~10 MB) downloads automatically on first launch.

Keyboard shortcuts

Key Action
18 Pick color directly
C Clear canvas
S Save current frame as PNG
+ / - Brush size up/down
Q / ESC Quit

Colors

Red · Orange · Yellow · Green · Blue · Purple · Pink · White

Switch with pinch gesture or keys 18.

Project structure

main.py         – entry point, camera loop
config.py       – colors, constants, settings
gestures.py     – gesture classification logic
overlay.py      – UI rendering (palette, status bar, cursor)

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages