Background-aware removal
Detect existing transparency, magenta keys, checkerboards, or a solid edge color. Checker detection accounts for the expected color at each position.
Keep the art. Lose the background.
A drag-and-drop desktop tool for turning keyed game art and sprite sheets into clean transparent PNGs. Built for magenta, baked-in checkerboard, and solid backgrounds, with asset splitting and icon conversion in the same workflow.

Keep the art. Lose the background.
PROJECT BRIEF
The main pipeline uses Pillow, NumPy, and OpenCV. Neural upscaling is optional and needs its additional engine and model weights; it is not required for ordinary background removal.
WHAT IT DOES
Detect existing transparency, magenta keys, checkerboards, or a solid edge color. Checker detection accounts for the expected color at each position.
Keep a sheet intact or split individual items into trimmed PNGs. Split output includes a manifest with source coordinates.
Erode contaminated rims, feather alpha, and bleed edge colors into transparent pixels to reduce halos when game textures are filtered.
Build multi-size ICO files and a 512px PNG master. Choose crisp nearest-neighbor scaling, pixel-art-aware Scale2x, or optional Real-ESRGAN upscaling.
THE FLOW
Add image files or a whole folder.
Choose the output mode, background settings, and scale method.
Save cleaned PNGs, split assets, or a multi-size icon.
INSIDE THE CODE / PYTHON
This classifier checks for existing alpha, samples an image’s border, tests for a magenta key, then looks for checkerboard luminance patterns. The classification selects the removal path; one global color threshold does not have to handle every image.
Read the engineering note ↗def detect_background(rgba: np.ndarray) -> str:
"""Classify the background: existing alpha, magenta key, checker, or solid."""
if (rgba[:, :, 3] < 250).mean() >= 0.05:
return BG_ALPHA
ring = _border_ring(rgba)
rgb = ring[:, :3].astype(np.float32)
if _magenta_mask_flat(rgb, DEFAULT_KEY_TOLERANCE).mean() >= 0.35:
return BG_MAGENTA
spread = rgb.max(axis=1) - rgb.min(axis=1)
neutral = spread <= CHECKER_NEUTRAL_SPREAD
# Two well-separated luminance clusters, both substantial -> checker.
if neutral.mean() >= 0.5 and _checker_luminances(rgba) is not None:
return BG_CHECKER
return BG_SOLIDGOOD QUESTIONS
Yes. It can remove a checkerboard baked into the image, rather than mistaking that pattern for real alpha transparency.
Yes. Full-sheet output preserves the layout. Split output trims individual assets and writes source coordinates to a manifest.
No. Background removal and the regular scaling methods work without the optional neural upscaling dependencies.
KEEP IN TOUCH
For project questions, build availability, or a conversation about software and games.
admin@updawg.studio ↗