image-region-remove-key-color-app
Skill210 starsChanged 2 days agoMITView on GitHub
Interactive Gradio UI to paint a region and remove solid key-color background (white / green / magenta) only inside that selection. Use when enclosed white islands remain after border/both keying, for localized white-background cutout, paint-to-erase chroma patches, or selective color-key cleanup before Godot sprite import.
- Installs packages
1 other project uses a version of this.
Adopted by
Most recently taken up by
- godot-fun/godot-agentword for word, first seen Nov 15, 2026
Other versions1 project uses a version of this.
Word for word · 1
- godot-fun/godot-agent★ 210100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository40 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .agents/skills/AGENTS.mdAGENTS.md
- ai-text-to-speechSkill
- audio-denoiseSkill
- audio-fadeSkill
- audio-loudness-normalizationSkill
- audio-sample-rate-standardizeSkill
- audio-splitSkill
- audio-to-oggSkill
- audio-to-textSkill
- audio-to-wavSkill
- audio-trimSkill
- audio-volume-adjustSkill
- file-naming-normalizationSkill
- git-commit-messageSkill
- image-inpaint-regionSkill
- image-remove-backgroundSkill
- image-remove-white-backgroundSkill
- image-resizeSkill
- image-sprite-sheet-splitSkill
- image-to-pngSkill
- image-to-textSkill
- image-trimSkill
- storyboard-av-mixSkill
- storyboard-shot-to-htmlSkill
- storyboardSkill
- storyboard-ttsSkill
- video-4k-normalizationSkill
- video-bgmSkill
- video-compress-to-sizeSkill
- video-cutSkill
- video-merge-gpuSkill
- video-mergeSkill
- video-publishSkill
- video-remove-audioSkill
- video-to-4kSkill
- video-to-60fpsSkill
- video-to-mp4Skill
- video-to-ogvSkill
- video-to-wavSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 1 is distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
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
- Distinctive: line 14
Use after image-remove-white-background when edge flood fill leaves enclosed white islands (e.g.
- Very specific: line 18
When this skill applies, read and follow dependency-manager — run scripts as documented, install missing tools into .dependency/.
- Very specific: line 20
Run app.py through the image-region-remove-key-color-app manifest entry (.dependency/image-region-remove-key-color-app/.venv/).
- Very specific: line 21
Do not hand-write a one-off Gradio app — use the bundled script at .ai/image-region-remove-key-color-app/app.py.
- Very specific: line 34
If python -m venv fails (missing venv / ensurepip), create the env with virtualenv from another populated skill venv, then install packages …
- Very specific: line 51
Use bin/python on Unix.
- Very specific: line 77
Use the UI color picker (default #FFFFFF).
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 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
Image Region Remove Key Color App
Paint a region mask in a local Gradio UI, then remove key-color pixels only inside that region (global keying scoped to the brush). Preserves white/light subject pixels outside the paint strokes.
Use after image-remove-white-background when edge flood fill leaves enclosed white islands (e.g. gaps inside a silhouette).
Rules
When this skill applies, read and follow dependency-manager — run scripts as documented, install missing tools into .dependency/.
- Run
app.pythrough theimage-region-remove-key-color-appmanifest entry (.dependency/image-region-remove-key-color-app/.venv/). Never use hostpython,py,python3, or any interpreter outside.dependency/. - Do not hand-write a one-off Gradio app — use the bundled script at
.ai/image-region-remove-key-color-app/app.py. populated: falseis not a reason to skip. Install first, setpopulated: true, retry the same command.- This skill is interactive: launch the UI, give the user the local URL, wait for them to paint / Apply / Download.
Setup (first run)
From project root:
.dependency/python/python -m venv .dependency/image-region-remove-key-color-app/.venv
.dependency/image-region-remove-key-color-app/.venv/Scripts/python.exe -m pip install Pillow gradioIf python -m venv fails (missing venv / ensurepip), create the env with virtualenv from another populated skill venv, then install packages into the new env:
.dependency/rembg/.venv/Scripts/python.exe -m pip install virtualenv
.dependency/rembg/.venv/Scripts/python.exe -m virtualenv .dependency/image-region-remove-key-color-app/.venv
.dependency/image-region-remove-key-color-app/.venv/Scripts/python.exe -m pip install Pillow gradioRegister in .dependency/manifest.json:
"image-region-remove-key-color-app": {
"populated": true,
"bin": ".dependency/image-region-remove-key-color-app/.venv/Scripts/python.exe"
}Use bin/python on Unix.
Quick Start
# Preload an image (opens http://127.0.0.1:7860)
.dependency/image-region-remove-key-color-app/.venv/Scripts/python.exe .ai/image-region-remove-key-color-app/app.py path/to/sprite.png
# Custom port, no auto-open browser (agent / headless)
.dependency/image-region-remove-key-color-app/.venv/Scripts/python.exe .ai/image-region-remove-key-color-app/app.py path/to/sprite.png --port 7861 --no-browserDownload uses the same filename as the source (forced .png). No share / no save-to-disk folder.
UI workflow
- Upload the image via the file control (or preload via CLI) — do not drop into the editor canvas.
- Transparent areas appear as gray in the editor (download still has real alpha).
- Paint over local white / chroma patches to remove.
- Choose Key color / tolerance / feather if needed.
- Click Apply → preview (gray = transparent).
- Click Download → browser download with the original name.
- Click Stop server when done (or
Ctrl+Cin the terminal).
Key color
Use the UI color picker (default #FFFFFF). CLI --preset only sets the initial color and tolerance:
--preset | Key color | Default tolerance |
white (default) | #FFFFFF | 25 |
green | #00FF00 | 40 |
magenta | #FF00FF | 40 |
Agent workflow
- When — user needs selective / painted removal of flat key-color patches; full-image
globalwould damage white subjects;border/bothleft enclosed islands. - Ensure deps — manifest entry + venv with Pillow + Gradio.
- Launch — run
app.pywith the user image path; prefer--no-browserif the agent cannot open a GUI browser, and printhttp://127.0.0.1:<port>. - Hand off — tell the user to paint, Apply, then Download (same filename as source).
- Verify — after the user confirms download, they are done; do not overwrite sources.
- Stop — click Stop server in the UI, or terminate the Gradio process when the user is done.
Defaults
| Option | Default | Notes |
| Download name | same as source (.png) | Prepared on Apply via DownloadButton |
--preset | white | Match the batch key skill |
--tolerance | preset-specific | Raise for gray fringes |
--feather | 2 | Softens hole edges inside the paint mask |
--port | 7860 | Change if busy |
| Share | off | share=False; no share UI |
Troubleshooting
| Issue | Fix |
| Manifest / venv missing | Follow Setup; update manifest |
No paint strokes found | Brush visibly over the white islands; ensure strokes are on the editor layers |
| Subject holes outside paint | Only paint the background islands — strokes gate keying |
| Leftover fringe in region | Raise tolerance by 5–10 |
| Port in use | Pass --port 7861 (etc.) |
| Gradio import error | Reinstall in the skill venv: pip install -U Pillow gradio |
CLI
Copy-paste commands: cli/image-region-remove-key-color-app.md
Related
- Full-image / batch keying: image-remove-white-background
- AI matting: image-remove-background
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.

