AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Image Chroma Remove

skill-mbtz-agent-skills-image-chroma-remove · by mbtz

Use when an image has a flat chroma-key background that should become real transparency, especially for pixel-art sprites generated on green, magenta, cyan, or another solid removable background. Supports explicit key colors, sampled border/corner keys, edge cleanup, alpha validation, and optional nearest-neighbor resizing for exact sprite dimensions.

— No reviews yet
0 installs
30 views
0.0% view→install

Install

$ agentstack add skill-mbtz-agent-skills-image-chroma-remove

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • ✓ Prompt-injection patterns
  • ✓ Secret / credential exfiltration
  • ✓ Dangerous shell & filesystem operations
  • ✓ Untrusted network calls
  • ✓ Known-malicious package signatures

What it can access

  • ✓ Network access No
  • ✓ Filesystem access No
  • ✓ Shell / process execution No
  • ✓ Environment & secrets No
  • ✓ Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-mbtz-agent-skills-image-chroma-remove)

Reliability & compatibility

✓ Security review passed
0 installs to date
— no reviews yet
○ 4mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Image Chroma Remove? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Image Chroma Remove

Convert a flat chroma-key background into real alpha transparency. This is useful after generating pixel-art icons or sprites on a solid key color because the image model cannot always produce true transparent PNGs directly.

Quick Start

Use the bundled script:

export CODEX_HOME="${CODEX_HOME:-$HOME/.codex}"
export CHROMA_REMOVE="$CODEX_HOME/skills/image-chroma-remove/scripts/remove_chroma.py"
python3 "$CHROMA_REMOVE" --input source.png --out sprite.png --auto-key border --soft-matte --despill

For exact pixel-art output size:

python3 "$CHROMA_REMOVE" \
  --input source.png \
  --out r_sticks.png \
  --auto-key border \
  --soft-matte \
  --despill \
  --resize 64x64 \
  --resample nearest

For a non-green key:

python3 "$CHROMA_REMOVE" --input source.png --out sprite.png --key-color "#ff00ff" --soft-matte --despill

Workflow

  1. Choose a key color that does not appear in the subject. Common choices: #00ff00, #ff00ff, #00ffff.
  2. Generate or provide an image with a perfectly flat key background: no shadows, gradients, checkerboards, floor plane, or texture.
  3. Prefer --auto-key border when the background reaches the image edges; use --auto-key corners when the subject may touch borders but corners are clear.
  4. Use --key-color "#rrggbb" when the intended key color is known and generation preserved it closely.
  5. For pixel art, include --resize WIDTHxHEIGHT --resample nearest only after alpha removal.
  6. Validate output with --validate or inspect transparent corners before using the sprite in a project.

Script Options

Core options:

  • --input: source image with chroma-key background.
  • --out: output .png or .webp with alpha.
  • --key-color "#rrggbb": explicit key color.
  • --auto-key none|corners|border: sample the key color from the image.
  • --tolerance: hard key threshold for exact removal.
  • --soft-matte: create partially transparent edge pixels between thresholds.
  • --transparent-threshold and --opaque-threshold: tune soft matte.
  • --edge-contract: remove a thin fringe by shrinking alpha.
  • --edge-feather: soften stair-stepped edges only when appropriate.
  • --despill: reduce key-color tint on edge pixels.
  • --connected-background: remove only key-like pixels connected to the image border. Use this for noisy generated chroma backgrounds so isolated purple/green/blue details inside the subject are preserved.
  • --connected-tolerance: tolerance for --connected-background; defaults to --tolerance.
  • --flatten-background-out PATH: also write a copy where connected background pixels are replaced with one exact key color. Use this when you want an auditable flattened raw source before exact removal.
  • --flatten-disconnected-threshold N: while writing the flattened source, also flatten disconnected pixels within N color distance of the key. Use this for small isolated background remnants after border-connected flattening.
  • --resize WIDTHxHEIGHT: write an exact output size.
  • --resample nearest|lanczos: use nearest for pixel art.
  • --trim: crop to the alpha bounding box before optional resize.
  • --pad N: add transparent padding after trimming.
  • --validate: fail if the output has no alpha, opaque corners, or too little visible subject.
  • --force: overwrite an existing output.

Pixel-Art Defaults

For generated sprite icons, use:

python3 "$CHROMA_REMOVE" \
  --input chroma_source.png \
  --out sprite.png \
  --auto-key border \
  --soft-matte \
  --transparent-threshold 12 \
  --opaque-threshold 220 \
  --despill \
  --resize 64x64 \
  --resample nearest \
  --validate \
  --force

If the edge still has a visible color fringe, retry once with --edge-contract 1.

For noisy generated backgrounds, prefer a border-connected hard mask before trying soft matte:

python3 "$CHROMA_REMOVE" \
  --input chroma_source.png \
  --out sprite.png \
  --key-color "#ff00ff" \
  --connected-background \
  --connected-tolerance 32 \
  --resize 64x64 \
  --resample nearest \
  --validate \
  --force

This removes only key-like pixels reachable from the image border. It is safer than broad global tolerance when the subject contains similar colors.

To create a flattened chroma source for audit or a second exact-removal pass:

python3 "$CHROMA_REMOVE" \
  --input chroma_source.png \
  --out preview_alpha.png \
  --auto-key border \
  --connected-background \
  --connected-tolerance 50 \
  --flatten-background-out chroma_flattened.png \
  --force

For generated atlases with small disconnected background flecks, add:

  --flatten-disconnected-threshold 20

Then run a second pass on chroma_flattened.png with exact or low-tolerance removal.

Dependencies

Requires Pillow:

python3 -m pip install pillow

When available, prefer the bundled workspace Python because it usually already has Pillow installed.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.