optimize_sprite
Convert oversized AI-generated sprites into game-ready pixel art: downscale with area-averaging, remove backgrounds, and crop automatically.
Instructions
Optimize an existing sprite PNG for pixel art games. Downscales large AI-generated sprites to proper pixel art resolution using area-averaging (not blurry bilinear). Also optionally removes background and crops. Use this to convert oversized "pixel art style" images into true pixel art at game-ready sizes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | Yes | Target size in pixels for the longest side. Snaps to nearest standard size (16, 24, 32, 48, 64, 96, 128). Recommended: 16-24 for icons/particles, 32 for tiles, 48 for sprites, 64 for characters, 96-128 for bosses. | |
| square | No | Pad output to square (default: false) | |
| inputPath | Yes | Path to the input PNG file | |
| outputPath | No | Output path (default: overwrites input) | |
| removeBackground | No | Auto-detect and remove background color (default: true) |