Alpha Cutout logo

Alpha Cutout

Community
Moh4696
alpha-cutout

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.

Overview

PublisherMoh4696
Repositoryopen-3d-skills
Skill namealpha-cutout
Stars
193
Forks
30
Bundled files
4
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by Moh4696 on GitHub. Read the source before you install it.

Installation

Install the Alpha Cutout AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/Moh4696/open-3d-skills/tree/main/skills/alpha-cutout
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Moh4696/open-3d-skills.git /tmp/open-3d-skills
mkdir -p .claude/skills
cp -r /tmp/open-3d-skills/skills/alpha-cutout .claude/skills/alpha-cutout
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Alpha Cutout in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Alpha Cutout on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Alpha Cutout is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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

FileWhat it does
scripts/plate.pyPlaces a cut-out subject on a key plate with headroom; picks the key colour the subject clashes with least
scripts/key.pyKeys a clip or still into stacked MP4, VP9 alpha WebM, RGBA WebP frames or PNGs
assets/alpha-video.jsPlays 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.

    bash
    python3 scripts/plate.py 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.

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

  4. Key it.

    bash
    python3 scripts/key.py clip.mp4 --png check/ --frame-list 0,40,80,120   # inspect first
    python3 scripts/key.py clip.mp4 --stacked hero-1080.mp4 --width 1080
    python3 scripts/key.py clip.mp4 --stacked hero-720.mp4 --width 720      # phones
    python3 scripts/key.py 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.

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

Fixes

You seeDo
A thin outline that follows the subject--erode 1 (rarely 2). The model copied a fringe into the artwork
Holes in light or shiny partsThat colour is too close to the key. Regenerate on a different key (plate.py --key)
Pink or green wash over the whole backgroundThe 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 compressionAlready 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

Which output

OutputPlays inUse for
--stacked MP4 + assets/alpha-video.jsEvery browser, Safari and iOS includedLooping heroes, characters, anything that plays
--webm VP9 alphaChrome, Edge, Firefox. Not SafariA plain <video> tag where Safari support is not needed
--frames WebP sequenceEverywhereScroll-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.

js
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.py does; python3 -m http.server does not), or seeking will not work.

Reduced motion

With prefers-reduced-motion: reduce, show one keyed still (--png a good frame, convert to WebP) instead of the loop.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Alpha Cutout AI skill do?

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

Why use Alpha Cutout on TypingMind?

Because you install it once and use it with any model. Alpha Cutout is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Alpha Cutout in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Moh4696/open-3d-skills/tree/main/skills/alpha-cutout. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Alpha Cutout?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Alpha Cutout?

As many as you like. As long as a model supports skills, you can use Alpha Cutout with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Alpha Cutout AI skill free?

Yes. It is published on GitHub by Moh4696 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇