Skip to main content
skill CX Codex

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.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add 0xheycat/isometric-game-skills --skill transparent-cutout-cleanup -a claude-code
Open on GitHub

What 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-code

2Manually: put the files in place

~/.claude/skills/transparent-cutout-cleanup/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/transparent-cutout-cleanup/

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

Similar skills

All skills for Game dev and 3D: Unity, Unreal, Godot, Blender →

From the same set21

using-isometric-skills A meta-skill that picks the right specialized skill for an isometric game task and sets the order to run them, before any code or art gets written. CX Codex +1 ★ 41repo stars tilemap-data-format This skill guides the design of JSON tilemaps with layers and gameplay metadata. Use it when maps live in source code or need walkability data alongside visuals. CX Codex +1 ★ 41repo stars tile-picking-interaction Turns a pointer or touch position into the exact isometric tile under it, with camera pan and zoom taken into account. Useful when clicks land on the wrong cell. CX Codex +1 ★ 41repo stars spritesheet-atlas-packing Packs individual isometric sprites into a power-of-two texture atlas and emits a frame coordinate JSON map. CX Codex +1 ★ 41repo stars seamless-isometric-terrain This skill helps generate isometric terrain tiles in ComfyUI and assemble maps without visible gaps, edge mismatches, or color drift. CX Codex +1 ★ 41repo stars isometric-pathfinding A pathfinding skill for isometric games: A* over the walkable tile layer, diagonal moves that never cut blocked corners, results returned as grid tiles. CX Codex +1 ★ 41repo stars isometric-object-sprites Creates isolated 2:1 isometric game props like trees and rocks with matching scale, contact shadows, and defined tile ground anchors. CX Codex +1 ★ 41repo stars isometric-grid-math This skill guides an agent through grid-to-screen and screen-to-grid math for a 2:1 isometric projection. Use it to place tiles or pick a tile with the mouse. CX Codex +1 ★ 41repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor