alpha-cutout

Installation
SKILL.md

Alpha cutout

Image-to-video models never return alpha. A character that should stand between a giant headline and a sun disc, or a bottle that should float over a page, needs its background removed from every frame, cleanly enough that no fringe shows on any page colour. This skill does it the way a film studio does: shoot the subject on a flat key colour, then pull a matte per frame.

Tools

File What it does
scripts/plate.py Places a cut-out subject on a key plate with headroom; picks the key colour the subject clashes with least
scripts/key.py Keys a clip or still into stacked MP4, VP9 alpha WebM, RGBA WebP frames or PNGs
assets/alpha-video.js Plays a stacked-alpha MP4 with transparency on a canvas (WebGL), with seek() for scrubbing

Needs Python 3.9+, pip install numpy opencv-python-headless pillow, and ffmpeg on PATH.

Pipeline

  1. Cut the subject out of the still. Any background remover works. Check what it dropped: thin objects (a ball in the air, racket strings, hair) often go missing. Put them back by hand.

  2. Make the plate.

Installs
10
GitHub Stars
7
First Seen
1 day ago