huensan/sprite-studio
0
๐ฎ Sprite Studio
Turn any photo or render into a transparent, game-ready sprite.
- Background removal โ BiRefNet (MIT) predicts a foreground mask, applied as the alpha channel. Runs on ZeroGPU.
- Pixel-art pass (optional, CPU) โ area-averaged downscale to the target sprite size, median-cut palette quantization without dithering, and a hard alpha cut-off so edges are on or off rather than half-transparent.
The comparison slider shows the sprite upscaled back to source resolution with nearest-neighbour; the download is the PNG at its true sprite resolution.
Controls
API / MCP
The Space launches with mcp_server=True, so build_sprite is available both as a Gradio API endpoint and as an MCP tool.
from gradio_client import Client, handle_file
client = Client("<namespace>/sprite-studio")
(before_after, png_path) = client.predict(
image=handle_file("input.png"),
target_px=64,
palette_size=16,
alpha_threshold=128,
pixel_art=True,
api_name="/build_sprite",
)