Fix AI pixel art
Image models paint pictures that look like pixel art without being it: the blocks drift in size, the edges are blurred, and one red is forty reds. Polymation snaps them onto a true grid, one colour per cell at 1×, with a real palette. Games and Rive need the real thing.
- You bring
- "Pixel art" from ChatGPT, Gemini, Midjourney, Stable Diffusion, Flux or any other model: one picture, or a folder of them.
- You get
- Clean 1× PNGs and an enlarged preview to compare.
- Needs
- Nothing beyond the install.
Ask your assistant
- Snap
knight.pngonto a real pixel grid with at most 16 colours. - These 8 walk frames came out of ChatGPT slightly different sizes. Put them all on one grid with one palette.
- I drew a hat on my character with Gemini. Line it up with the original exactly and give me the hat as its own layer.
- Map this sprite onto my game's palette:
#1a1c2c, #5d275d, #b13e53, …
How it works
snap_pixel_artmeasures the block size, rebuilds the grid, merges near-identical colours and removes a flat background. It writes the picture at 1× and an enlarged preview.- Your assistant looks at the preview beside the original, and adjusts only what looks wrong:
- Too many colours: a colour limit, or your own palette.
- Stray single pixels: a clean-up of small specks.
- A broken outline: one even 1-pixel outline in the darkest colour.
- The figure should be smaller: a height in pixels, for a coarser grid than the model drew.
- A green fringe at the edge: spill removal.
- Background left behind: a looser tolerance.
Many pictures on one grid
- Frames or a set of items: give a folder. Every picture is snapped on one shared grid and colour set, so they stay consistent.
- An item, pose or face drawn over a character: snap the character first, then each variant against it. Each variant lands exactly on the character: lined up on its floor, matched by colour, and every unchanged pixel set back to the character's own.
extract_layerthen lifts the change out as its own layer.
Better pictures to start with
sprite_art_brief writes prompts for your image model that ask for a flat background colour the character doesn't use, a whole number of pixels per block, and one figure per picture.
After snapping
- Into Rive: pixel art is recognised and drawn crisp by itself, with no blur between pixels, at whole-number scales.
- Animate the character: Animate a pixel character.
- See what its colours became:
pixel_materialssplits the colours into materials (skin, each cloth, metal) and their shading levels. - Move parts of it simply:
split_imagemoves part of a picture on its own (clothes ride along), andsnap_motion_to_pixelsturns any motion into whole-pixel steps.
Good to know
- Crisp drawing of pixel art needs Rive's GPU renderer, which apps use. Rive's 2D-canvas web runtime smooths pictures, so scale pixel art up by whole pixels before using it there.
Related
- Animate a pixel character
- Video clip to sprite animation: frames from a video model, then snapped here.