Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Making Stable Diffusion output into real pixel art: the 4-step cleanup I use (grid, palette, cutout, upscale)

A topic by Holo Pixel Assets created 35 days ago Views: 316 Replies: 1
Viewing posts 1 to 2

Disclosure first: I make small pixel-art asset packs with Stable Diffusion (a pixel-art checkpoint run locally), and I label them as AI-generated on every page. Raw SD output is usually not real pixel art - it has blurry edges, hundreds of near-duplicate colors and "pixels" of inconsistent size. Here is the cleanup that made my results usable in an actual game:

1. Snap to a real pixel grid. Generate large (e.g. 512 px), then downscale to the target grid (say 64x64) with nearest-neighbor or box filtering. Pick the grid first and keep it the same for the whole set, otherwise sprites from one pack will not match each other.

2. Limit the palette. Quantize to 16-32 colors (median cut or a fixed palette). This removes the blur and the almost-identical shades, and it makes the set look consistent. Use one shared palette across a pack if you can.

3. Cut out the background cleanly. Flood-fill from the corners against the background color, then remove stray holes and 1 px fringe pixels around the silhouette. Do this at the small grid size, not on the big image - fringes are far easier to see and fix there. A quick check: put the sprite on a contrasting color and look for halos.

4. Upscale only with nearest-neighbor, by integer factors. 64 to 128, 256, 512 (x2, x4, x8). Never smooth-scale pixel art. Export each size as a separate transparent PNG.

Bonus tips

  • Generate many candidates and hand-pick; for each usable sprite I discard most of the batch.
  • Compare against real references (photos of the object) to catch anatomy/shape errors - AI often invents wrong details like extra handles or odd tools.
  • Check each sprite at 1x in-engine, not only zoomed in.
  • Be upfront about AI use on the store page - buyers appreciate it, and itch.io asks for it anyway.

I wrote the cleanup as a small Python script (Pillow + numpy). Happy to answer questions about any step, and I would like to hear what other people do for consistent palettes across a set.

This is a very solid pipeline, especially doing the cutout at the small grid size — fringes are almost invisible on the 512px version. For a shared palette across a pack, I usually build it from 3–4 hero sprites, then force every later piece onto that same ramp: one outline color, 2–3 shadow steps, and I merge near-identical hues instead of keeping all of them. I also test tiles on a repeating map and sprites on both light and dark ground, because a halo or a one-off color only shows up then. Thanks for writing the steps out so clearly.