transparent-cutout-cleanup — Claude Code skill: what it does
Removes halos, fringes, and leftover background pixels from AI sprites to produce clean straight-alpha cutouts.
npx skills add 0xheycat/isometric-game-skills --skill transparent-cutout-cleanup -a claude-codeWhat transparent-cutout-cleanup does
AI-generated game sprites arrive on flat or noisy backgrounds. Basic color-keying leaves bright fringes or jagged contours that look broken when placed on contrasting game tiles. This skill provides a step-by-step pipeline for building clean alpha masks.
The routine relies on background removal models like rembg or InSPyReNet instead of harsh chroma keys. It guides defringing, edge decontamination, and optional 1px alpha erosion before exporting straight-alpha PNG files for texture packers.
A sprite is rejected unless inspected at 400% zoom against both black and white backdrops. Hard color-keying is barred because it destroys edge anti-aliasing.
What it helps with
- Eliminate halo fringes around AI-generated sprite boundaries
- Decontaminate edge colors on semi-transparent boundary pixels
- Fix jagged outlines caused by harsh color keying
- Batch-prepare straight-alpha PNG sprites for texture atlas packing
Example prompts for the agent
- Clean up the alpha edges on these newly generated building sprites
- Check the character cutout at 400% zoom against a dark tile
- Defringe these isometric asset cutouts and export them with straight alpha
How to install transparent-cutout-cleanup
1Skills CLI (Vercel)
npx skills add 0xheycat/isometric-game-skills --skill transparent-cutout-cleanup -a claude-code2Manually: put the files in place
~/.claude/skills/transparent-cutout-cleanup/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/transparent-cutout-cleanup/
1Skills CLI (Vercel)
npx skills add 0xheycat/isometric-game-skills --skill transparent-cutout-cleanup -a codex2Manually: put the files in place
.agents/skills/transparent-cutout-cleanup/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add 0xheycat/isometric-game-skills --skill transparent-cutout-cleanup -a cursor2Manually: put the files in place
.cursor/skills/transparent-cutout-cleanup/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install 0xheycat/isometric-game-skills transparent-cutout-cleanup2Manually: put the files in place
.github/skills/transparent-cutout-cleanup/SKILL.md1Skills CLI (Vercel)
npx skills add 0xheycat/isometric-game-skills --skill transparent-cutout-cleanup -a gemini-cli2Platform CLI
gemini skills install https://github.com/0xheycat/isometric-game-skills --path skills/transparent-cutout-cleanupManually: put the files in place
.devin/skills/transparent-cutout-cleanup/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add 0xheycat/isometric-game-skills --skill transparent-cutout-cleanup -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about transparent-cutout-cleanup
How to install transparent-cutout-cleanup in Claude Code?
Run npx skills add 0xheycat/isometric-game-skills --skill transparent-cutout-cleanup -a claude-code in your terminal.
What does transparent-cutout-cleanup do?
It enforces matting quality standards: model-based removal with rembg, defringing, edge inspection at 400% zoom, and straight-alpha PNG export.
Why avoid a hard color-key?
Hard color keys discard semi-transparent pixels, leaving jagged edges; neural matting tools preserve proper anti-aliasing.
Source text
SKILL.md · MIT
--- name: transparent-cutout-cleanup description: Use when removing backgrounds from generated sprites to get clean alpha edges with no halo, fringe, or leftover background pixels. license: MIT --- # Transparent Cutout Cleanup ## Overview AI-generated sprites come on a background. Naive removal leaves a colored halo or jagged edge that screams amateur when tiles are placed together. This skill produces clean, premultiplied-safe alpha cutouts. ## When to Use - Any generated sprite needs a transparent background. - Placed sprites show a white/gray halo or fringe. - Edges look jagged or have leftover background color. ## Process 1. Generate on a PLAIN flat background (easier to key out than a busy one). 2. Use a background-removal model (e.g. InSPyReNet / rembg) rather than a hard color key. 3. Inspect edges at 400% zoom for halo or fringe pixels. 4. Defringe / decontaminate edge color so no background tint remains. 5. Erode the alpha by 1px if a faint halo persists. 6. Save as PNG with straight alpha; verify on both light and dark backgrounds. 7. Batch the cleaned sprites for the atlas packer. Pair this with the ComfyUI rembg node in `seamless-isometric-terrain/scripts`. ## Rationalizations (Stop Lying to Yourself) | Excuse | Reality | |---|---| | "A white halo is barely visible" | On a dark tile it is glaring. Defringe every sprite. | | "Hard color-key is faster" | It eats anti-aliased edges and looks jagged. Use a proper matting model. | ## Red Flags - STOP if you catch yourself: - Visible halo/fringe when placed on a contrasting background. - Jagged, aliased cutout edges. - Background color contaminating semi-transparent pixels. ## Verification You are NOT done until every box is checked: - [ ] Edges are clean at 400% zoom on light AND dark backgrounds. - [ ] No background-color contamination on semi-transparent pixels. - [ ] All sprites exported as straight-alpha PNG.
© 0xheycat · MIT · 0xheycat/isometric-game-skills