image_to_pixel_art
Convert images into clean, true-grid pixel-art sprites. Detect real pixel grids from upscaled AI art or downsample photos, then reduce colors and add optional outlines.
Instructions
Convert an image into a clean, true-grid pixel-art sprite.
Handles three kinds of input:
Upscaled or AI-generated "pixel art" (blurry, off-grid pixels, many near-identical colours): the real pixel grid is detected and each cell becomes exactly one pixel.
A painting, photo or concept art: scaled down to
widthpx, sampling each cell's median colour (no blur).Either way the colours are reduced perceptually (OKLab k-means) to
colors, or snapped to your palette/preset, stray pixels are cleaned and an optional outline is added. A flat background touching the image border is made transparent.
The result is a new .aseprite file, ready for critique_sprite and hand refinement (conversion is a starting point, not a finish).
Args: image_path: PNG/JPG/WebP/GIF to convert output_filename: .aseprite file to create width: Target width in px (0 = auto: the detected grid, else 64) colors: Palette size when no palette is given, 2-64 palette: Hex colours to snap to preset: Or a palette preset (pico8, dawnbringer32, gameboy, ...) dither: none, bayer2, bayer4, bayer8, floyd, atkinson remove_bg: Make a flat border-connected background transparent outline: "", "fixed" (near-black), "colored" or "selective" cleanup: Remove stray pixels after converting layer_name: Name of the layer in the new sprite
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"image_path": "<image_path>",
"output_filename": "<output_filename>"
},
"name": "image_to_pixel_art"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| width | No | ||
| colors | No | ||
| dither | No | none | |
| preset | No | ||
| cleanup | No | ||
| outline | No | ||
| palette | No | ||
| remove_bg | No | ||
| image_path | Yes | ||
| layer_name | No | art | |
| output_filename | Yes |