Magenta Sprite / Outline
Cut out magenta-keyed sprites with a hard dark outline — only the background goes, enclosed magenta in the subject stays.
Summary
Magenta Sprite / Outline cuts out sprites with a hard dark outline on a magenta-keyed
background. It removes only the magenta that's connected to the image border and leaves enclosed
magenta/violet/pink in the subject standing. An edge cleanup then tidies magenta-contaminated outline
pixels into a clean dark edge (#12091f).
When to use it
- Your sprite is keyed on magenta and has a hard, dark outline (the classic pixel-art outline).
- The subject contains its own magenta/pink/violet that has to stay.
- The background is not exactly
#FF00FF— real keys vary (e.g.(242,5,236),(234,12,199)); a plain distance check against#FF00FFisn't enough.
When not this profile:
- Water/light/fog/energy FX, where a black outline neutralization would be wrong → Magenta FX / Water.
- Pink fringes left over after FX cleanup → Magenta FX / Water Plus.
- Translucent glow effects with soft alpha → FX / Glow (Soft Matte).
How it works
The background is found by a magenta-like detection — red and blue dominant, green clearly lower
(roughly R>140, B>140, G<150, R>G+45, B>G+45). Only magenta-like pixels reachable from the
image border are removed (the edge-connected flood) — isolated magenta details inside the sprite are
preserved.
After keying, the Edge cleanup checks remaining opaque pixels within 1–2 px of the transparency:
dark, magenta-contaminated outline pixels (R>G+8, B>G+8, luminance <120) are neutralized into the
clean dark outline #12091f. The edge stays hard (the pixel-art invariant).
Settings
| Slider | Effect |
|---|---|
| Key color | The magenta key color. Quick button #FF00FF; pick it from the image with the eyedropper (real keys often deviate). |
| Edge cleanup | On (default) neutralizes contaminated outline pixels to #12091f; Off removes only the background. |
| Spill radius | Width of the treated edge band (1–4, default 2). |
| Spill strength | Soft / Normal / Strong / Maximum — aggressiveness of the edge correction. |
Recommended settings by use case:
| Asset type | Recommendation |
|---|---|
| Magenta sprite with a dark outline | Default (Edge cleanup on) |
| Keep the hard edge exactly, only background out | Edge cleanup Off |
| A pink fringe stays visible | → Magenta FX / Water Plus |
CLI / Automation
Headless, the same magenta keying — invocation and shared flags in the CLI overview. You pick
this profile with --profile magenta_sprite.
Relevant flags: --key-color (magenta key, default #FF00FF; real keys often deviate),
--edge-cleanup {on,off} (neutralizes contaminated outline pixels to #12091f) plus --spill-radius /
--spill-strength.
Example:
clean_sprite_chromakey.py sprite.png sprite_out.png --profile magenta_sprite --key-color #FF00FF
FAQ
Why does magenta inside the sprite stay? That's intended: only edge-connected background magenta is removed. Enclosed magenta/pink details belong to the subject and are preserved.
My key isn't exactly #FF00FF — does it still work?
Yes. Detection runs on magenta dominance (R/B high, G low), not on plain distance to #FF00FF. Pick
the real BG color with the eyedropper for a precise result.
The outline still looks pink/contaminated after keying.
The Edge cleanup (on) neutralizes dark, contaminated outline pixels to #12091f. If a bright pink
fringe remains, Magenta FX / Water Plus is the right profile.
Limits
- Black outline neutralization is wrong for FX assets — don't pull water/light edges to black there; use Magenta FX / Water.
- Hard alpha (0/255) — for soft, translucent effects, FX / Glow is in charge.
- No scaling / no resampling.
Examples
![]()
Magenta background removed — hard pixel-art edges, content stays.
Related features
- Magenta FX / Water — for water/light/energy FX (no black outline neutralization).
- Magenta FX / Water Plus — for stubborn pink fringes after FX cleanup.