I taught my webcam to stretch my face like Luffy from One Piece.
No AI. No After Effects. No filter app. Just Python.
Here’s exactly how it works 👇
The stack is free and runs in real time on a regular laptop — no GPU:
• Python
• OpenCV (webcam feed)
• MediaPipe (face + hand tracking)
First, the face. MediaPipe Face Mesh gives you 468 points on your face, 30 times per second. That’s the “skeleton” you deform — cheeks, lips, eyes, every pixel mapped to a coordinate.
Then the hand. MediaPipe Hands gives 21 points per hand. You measure the distance between the thumb tip (point 4) and the index tip (point 8). Small distance = a pinch. That’s your “grab” trigger.
When the pinch fires, you find the nearest face point under your fingers and lock it as the origin. Now your hand is physically “holding” your skin.
Here’s the magic — the warp. You build a displacement map: pixels near the origin get pulled toward your hand, with the strength falling off as you move away from the grab point (feather / falloff). Then cv2.remap() applies that map to the frame, and the face goes full rubber.
The detail that actually sells it: snap-back. When you release the pinch, the face springs back with an elastic ease-out. That’s what makes it feel like rubber instead of a broken photo.
A few sliders to dial it in:
• over — stretch strength
• feather — edge softness
• region — grab radius
• back — return speed
Tweak until it looks straight out of the anime.
That’s it. Luffy in one evening 🏴☠️
If this was useful — ❤️ + 🔁 so it reaches more people, and 🔖 bookmark it before it’s gone. Follow for more CV builds like this.