chroma-key-cutout
Skill1 starsChanged 3 months agoMITView on GitHub
Use when the user asks to remove green-screen or chroma-key backgrounds from local raster images, create transparent PNG cutouts, validate alpha edges, or batch-repeat the same keying workflow for UI/game/art assets.
In this repository42 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .agents/notes/AGENTS.mdAGENTS.md
- .agents/notes/archived/AGENTS.mdAGENTS.md
- .agents/notes/implemented/AGENTS.mdAGENTS.md
- benchmarks/AGENTS.mdAGENTS.md
- docs/AGENTS.mdAGENTS.md
- .github/AGENTS.mdAGENTS.md
- packages/AGENTS.mdAGENTS.md
- scripts/AGENTS.mdAGENTS.md
- snapshots/AGENTS.mdAGENTS.md
- vendor/AGENTS.mdAGENTS.md
- website/AGENTS.mdAGENTS.md
- architecture-planningSkill
- browser-cdp-automationSkill
- code-reviewSkill
- dataops-workspace-image-customizationSkill
- design-taste-frontendSkill
- dsh-archive-agent-notesSkill
- dsh-base-upgradeSkill
- dsh-ci-test-reliabilitySkill
- dsh-code-reviewSkill
- dsh-docSkill
- dsh-find-simplificationsSkill
- dsh-merging-stacked-prsSkill
- dsh-plugin-ownership-and-distributionSkill
- dsh-pre-push-checksSkill
- dsh-promote-deploymentSkill
- dsh-prose-standardSkill
- dsh-repo-release-prSkill
- dsh-skill-discovery-linksSkill
- dsh-speed-up-perfSkill
- dsh-supervisor-restartSkill
- dsh-translate-docsSkill
- dsh-trim-cot-leakageSkill
- implementationSkill
- office-monthly-progress-reportSkill
- online-course-automationSkill
- online-exam-automationSkill
- product-designSkill
- record-browser-gifSkill
- test-governanceSkill
- verificationSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 2 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 18
Verify the PNG is RGBA, corner alpha is 0, and alpha extrema include (0, 255).
- Very specific: line 22
Use default --mode strict when green-screen pixels may appear inside holes, such as an outlined heart or transparent UI center.
- Very specific: line 23
Use --mode connected when foreground art contains exact green areas that must survive and only the outer background should disappear.
- Distinctive: line 54
Never overwrite a source file.
- Distinctive: line 56
Always make a dark preview for visual QA.
- Very specific: line 57
If text or fine black edges show green spill, rerun with a stricter key color or reduce --soft-high.
- Very specific: line 58
If foreground gets deleted, switch to --mode connected or narrow --max-rb.
- Very specific: line 59
If enclosed green holes remain, switch back to --mode strict.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Chroma Key Cutout
Overview
Creates alpha PNG cutouts from green-screen assets with deterministic local processing. Prefer this over model image editing when the source already has a removable chroma-key background.
Workflow
- Inspect source with
fileand, if useful,view_image. - Sample border color or pass an explicit key color.
- Run
scripts/chroma_key_cutout.py. - Inspect the dark preview for holes, green fringe, and accidental removal.
- Verify the PNG is
RGBA, corner alpha is0, and alpha extrema include(0, 255).
Mode Choice
- Use default
--mode strictwhen green-screen pixels may appear inside holes, such as an outlined heart or transparent UI center. - Use
--mode connectedwhen foreground art contains exact green areas that must survive and only the outer background should disappear. - Pass
--key-color '#00ff00'only when automatic border sampling chooses the wrong color.
Commands
Single image:
python3 /root/projects/.agents/skills/chroma-key-cutout/scripts/chroma_key_cutout.py \
--input "/root/projects/source.png"Explicit output:
python3 /root/projects/.agents/skills/chroma-key-cutout/scripts/chroma_key_cutout.py \
--input "/root/projects/source.png" \
--output "/root/projects/source-cutout.png" \
--preview "/root/projects/source-cutout-preview-dark.png"Preserve non-border exact-green foreground:
python3 /root/projects/.agents/skills/chroma-key-cutout/scripts/chroma_key_cutout.py \
--input "/root/projects/source.png" \
--mode connectedQuality Rules
- Never overwrite a source file.
- Save transparent output beside the source unless the user gives a destination.
- Always make a dark preview for visual QA.
- If text or fine black edges show green spill, rerun with a stricter key color or reduce
--soft-high. - If foreground gets deleted, switch to
--mode connectedor narrow--max-rb. - If enclosed green holes remain, switch back to
--mode strict.
Dependencies
Requires Python3 plus Pillow and numpy.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

