Inspiration

I made PixelAid for the part of pixel art cleanup that kept wasting my night.

AI image tools can give you a cute sprite in seconds. So can a quick Photoshop pass, a screenshot crop, an old exported sheet, or a tool that says “pixel art” and leaves you with a giant blurry PNG. The image looks fine in a chat window. Then you open it in Aseprite, Unity, Godot, or your own engine and the whole thing falls apart: fake pixels, too many colors, weird transparency, a halo around the edge.

PixelAid starts after the image exists. It looks at the file, guesses the grid it was trying to be, cleans the background, reduces accidental colors, preserves useful details, and exports something you can inspect or keep working on.

What it does

  • Pixel snapping and grid alignment for pixel-perfect images
  • chroma and smart background removal
  • color space recognition and flattening (ai images typically generate > 10,000 unique colors whereas pixel art typically uses 8 - 32 colors. We use CIELAB and other color space algorithms
  • Resize and clustering work. There are a lot of algorithms in here to make the output art deterministic, repeatable, and correct.
  • Frame size detection - PixelAid understands whether your image is a static sprite, a spritesheet, or a framegrid of multiple animations. It also offers sprite animation previews and players so you can apply your pixel art fixes to animations too

How we built it

I have a much longer essay on how it works and the algorithms used internally: https://oscarsanchez.com/essays/ai-pixelart-is-broken/ but essentially the app itself a headless runner with a main algorithm owning the detection and then spreading to different algorithms based on what we need to do. The headless capability allows me to release PixelAid as a cli, a web app, and a desktop app. So you can use it however you want. The source is free and it's also on itch.io

Challenges we ran into

  • Detection is hard, getting colors to match is hard, sizing is hard. But colors are definitely the worst - if you ask AI to make an image of a white cloud, there will be 10,000 shades of "white" in that output. It may not seem significant, but if you have a character with red hair, yellow jacket, blue pants, green socks, brown shoes - that's already 5/8 colors you can end up with!

Accomplishments that we're proud of

  • The headless app and ability to release in so many ways. Adding webmcp was really simple too!

What we learned

What's next for PixelAid

The algorithm can always be better. Image generation itself is not part of pixel aid either, and it can be.

Built With

Share this project:

Updates

Submission history