Turns an AI-generated (or filmed) clip of a character or product into a transparent, web-ready animation by shooting it on a flat chroma plate and keying it with per-frame plate measurement and edge unmixing. Delivers stacked-alpha MP4 that plays with transparency in every browser including Safari, VP9 alpha WebM, or keyed WebP frame sequences for scroll scrubbing. Use when an animated subject has to sit over page content, between layers of type, or over a 3D scene, when someone asks for "transparent video", "video with alpha", "remove the background from this clip", or when a generated video has a background that should not be there.
Ships in open-3d-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
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.
| File | What it does |
|---|---|
scripts/plate.rs | Places a cut-out subject on a key plate with headroom; picks the key colour the subject clashes with least |
scripts/key.rs | 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 Rust (cargo) and ffmpeg on PATH.
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.
Make the plate.
cargo run --release --bin plate -- subject.png plate.png --size 1350x1800 --fit 0.8
The script reports, for magenta, green and blue, how much of the subject sits close to that key, and picks the cleanest. Magenta is usually right: almost nothing in skin, clothing, product or foliage is pure magenta. Green fails on plants and green products; blue fails on denim and sky. The subject is pasted with a hard edge on purpose: a soft edge pre-mixed with the plate colour teaches the model to draw a fringe.
Leave room for the motion. A serve needs space above the head; a turn needs space to the side. Match the plate's aspect to the video model's output aspect so nothing gets cropped.
Generate on the plate. Use the plate as the start frame (and as the end frame for a seamless loop; see motion-assets). The prompt must name the plate, or the model invents a background:
The background must remain a completely flat, uniform, pure chroma-key magenta (exact RGB 255, 0, 255) filling the entire frame, with no shadows, no floor, no gradient, no vignette and no scenery. Locked-off camera.
The prompt wins over the image. A leftover "on a white background" in the prompt gets you a white background whatever the plate was. Re-read the prompt after every edit.
Key it.
cargo run --release --bin key -- clip.mp4 --png check/ --frame-list 0,40,80,120 # inspect first
cargo run --release --bin key -- clip.mp4 --stacked hero-1080.mp4 --width 1080
cargo run --release --bin key -- clip.mp4 --stacked hero-720.mp4 --width 720 # phones
cargo run --release --bin key -- clip.mp4 --frames serve/lg --width 960 --start 0 --end 78
--png prints the plate colour it measured in each frame. Models drift the plate: a pure magenta can come back pale pink (250, 178, 243) halfway through while the subject keeps its colours. That is why the key colour is measured per frame from the frame's own border instead of being set once. If the subject touches the top edge, the measurement breaks and the script says so.
Then, per pixel: alpha comes from how far the pixel's key excess is from the plate's, edge pixels are unmixed against the plate (F = (C - (1 - a) K) / a), and surviving spill is clamped. Unmixing matters. A plain colour-key or a clamp toward neutral turns magenta edge blends tan, which reads as a salmon outline on a white shirt; unmixing returns the real edge colour.
Check on three backgrounds: near-black, the page's light colour, and its loudest brand colour. Composite the --png output and look at the edges at 100% and 400%. Look hardest at hair, fingers, thin props, motion blur and the frame where the plate drifted most.
| You see | Do |
|---|---|
| A thin outline that follows the subject | --erode 1 (rarely 2). The model copied a fringe into the artwork |
| Holes in light or shiny parts | That colour is too close to the key. Regenerate on a different key (plate --key) |
| Pink or green wash over the whole background | The plate gradient is stronger than usual; check the measured plate colours and raise --solid slightly |
| A detail changed colour mid-clip (a cap turned green) | Model drift, not a keying fault. Recolour that hue in those frames, or regenerate |
| Coloured line round the subject after compression | Already handled: colour under transparent pixels is the subject's own edge colour pushed outward, so chroma subsampling has nothing foreign to bleed in. --fill only sets the colour far from the subject |
| Output | Plays in | Use for |
|---|---|---|
--stacked MP4 + assets/alpha-video.js | Every browser, Safari and iOS included | Looping heroes, characters, anything that plays |
--webm VP9 alpha | Chrome, Edge, Firefox. Not Safari | A plain <video> tag where Safari support is not needed |
--frames WebP sequence | Everywhere | Scroll-scrubbed motion (see scroll-film): exact frame per scroll position, no seeking lag |
Stacked alpha doubles the frame height (colour on top, matte below) and a shader recombines them, so it is plain H.264: it decodes in hardware everywhere and costs about 1.3 times the bytes of the colour alone. Ship two widths (1080 and 720) and choose by viewport.
import { AlphaVideo } from "./alpha-video.js";
const hero = new AlphaVideo(document.querySelector("canvas.hero"), innerWidth > 900 ? "hero-1080.mp4" : "hero-720.mp4");
hero.onready = () => document.body.classList.add("hero-ready");
function frame() { hero.draw(); requestAnimationFrame(frame); }
requestAnimationFrame(frame);
The player pauses itself off screen and uploads a texture only when the video has moved on. For scrubbing, create it with { loop: false, autoplay: false } and call hero.seek(seconds) from your scroll handler.
Serve videos from a server that answers HTTP Range requests (the frame-capture skill's serve binary does; python3 -m http.server does not), or seeking will not work.
With prefers-reduced-motion: reduce, show one keyed still (--png a good frame, convert to WebP) instead of the loop.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
8 skills in this plugin
/cursor-rigMakes a painted or illustrated character turn its head to follow the visitor's cursor, looking like one continuous painting that moves, without a 3D model or face tracking. Generates head-pose keyframes with an image-editing model and head-turn clips with an image-to-video model, then builds a pose grid on one fixed body (selected by measured head position, aligned, masked, with optical-flow in-betweens) and plays it with a spring-driven canvas player that also blinks. Use when someone wants a hero character, mascot or portrait whose eyes or face follow the mouse, a "look at the cursor" effect, or an illustration that reacts to the visitor./exploded-viewBuilds interactive 3D explainers of how a machine or product works, in three.js, with a staged exploded view driven by a slider or scroll, x-ray shells, a section cut through the casing, labels pinned to parts with leader lines that never cover the model, and hover or click to pick parts. Works on code-built models and loaded GLB files. Use for "show how it works", teardown or cutaway pages, product anatomy, engine, motor, gearbox, camera, phone or vehicle internals, technical education pages, or turning a 2D cutaway drawing into an interactive 3D one./frame-captureRecords any web page (three.js, WebGL, canvas, GSAP, CSS animation, scroll-driven video) to a perfectly smooth 60 fps MP4 by running the page on a virtual clock, one exact frame at a time, and puts two recordings against each other as a labelled stacked or side-by-side comparison. Use when someone wants a video of a site, a demo clip for X or YouTube, a scroll-through, a showcase reel of a 3D scene, or a "model A vs model B" comparison video. Also use when a screen recording of an animated page stutters or drops frames./motion-assetsPlans and generates the images and video clips an animated website needs with AI image and video models, without wasting money. Covers proposing the concept and asset list with exact prompts and costs before spending, keeping one style across every asset, start and end frames for clips that chain or loop, choosing a model by what it can do, calibrating cost, staying under rate limits, recovering failed jobs, fixing loops and outpaints, and logging every prompt so the project can be rebuilt. Use whenever a site needs generated heroes, characters, product shots, textures, background loops or camera-move clips, or when someone says "use Higgsfield", "use Runway", "use Kling", "use Veo", "generate the assets" or "animate this image"./scroll-filmBuilds scroll-scrubbed film sections, where scrolling plays a pre-rendered camera move, a product turning, a liquid pour or a fly-through one exact frame at a time, from AI-generated or rendered clips. Covers chaining clips into one seamless film with start and end frames, frame sequences versus scrub-ready video, pinned sections with holds for text, phone versions, loading budgets and reduced motion. Use for "scroll-driven animation", "Apple-style scroll video", "fly through the world as you scroll", scroll cinematics, or when a scrubbed video on a page stutters, jumps at a seam or loads too slowly./site-checkVerifies a 3D or animated web page in real headless browsers before anyone else sees it. Shoots every view, light state and scroll position at desktop, tablet and phone widths in Chromium and WebKit (Safari), measures frame time, draw calls and triangles, catches page errors, failed requests, blank WebGL canvases, horizontal overflow and reduced-motion behaviour, and builds one contact sheet. Use after building or changing any three.js, WebGL, canvas, scroll-driven or animated page, before publishing or recording it, or when someone asks "does it work", "check it on mobile", "why is it slow" or "test it in Safari"./open-3d-skills:alpha-cutoutfrom open-3d-skills
npx claudepluginhub bhubbard/open-3d-skills --plugin open-3d-skills