Toolkitly

Pixel Art Palette Converter

Read every colour out of an image, cut it down to a fixed count, or map the art onto a Game Boy, PICO-8 or Commodore 64 palette. Free, no sign-up, and every pixel stays in your browser.

Nothing is uploaded — the image is decoded and recoloured inside your browser.

How to convert an image to a palette

Four steps, and one setting most tools get wrong.

  1. 1Load your artDrag a PNG, WebP, GIF or JPEG onto the drop area, pick a file, or paste an image straight from the clipboard. The colour count under the file name is the number of distinct colours it actually contains.
  2. 2Choose where the palette comes fromEither from the image itself — reduced to 4, 8, 16, 32 or any count you type — or from one of the console palettes.
  3. 3Leave colour matching on “by how it looks”This is the setting that decides which palette colour each pixel lands on. Switch it to raw RGB and compare; on a small palette the difference is obvious.
  4. 4Export what you needThe recoloured PNG, or the palette on its own as .gpl, .hex, JSON or a swatch sheet.

Why “nearest colour” is not obvious

Snapping a pixel to a palette means measuring which palette entry it is closest to, and that requires deciding what closest means. The obvious answer — treat red, green and blue as three axes and take the straight-line distance — is the one most tools use, and it is wrong in a way you can see.

sRGB numbers are not proportional to brightness. A mid green like #005500 has small channel values, so by raw distance it is “dark” and gets sent to the darkest shade available. To the eye it is nothing of the sort: green carries most of the perceived brightness, and that green sits closer to a mid grey than a dark one.

The perceptual setting measures distance in OKLab, a colour space built so that equal numeric steps look like equal steps. On a sixteen-colour palette the two methods mostly agree. On a four-shade Game Boy palette they disagree constantly, and that is the difference between artwork that still reads and artwork that goes muddy.

How the colour count is chosen

Reducing an image to sixteen colours is two questions, not one: which sixteen, and then which of those each pixel becomes. The second is the nearest-colour search above. The first is median cut.

Every colour in the image starts in a single box. The box with the widest spread is split in half along whichever channel it is widest in, and that repeats until there are as many boxes as colours requested. Each box then collapses to the average of the colours inside it, weighted by how many pixels use them — so a sky covering half the frame pulls its box towards the sky, rather than being averaged into a compromise with the sprite in front of it.

This is the same routine the site's GIF export uses to fit an animation into 255 colours, which is why the two agree about what an image is made of.

Where the console palettes come from

PICO-8 and the Commodore 64 are numbers, not opinions: PICO-8 documents its sixteen, and the C64 palette here is Pepto's measured VIC-II set, which is the one the demoscene settled on. The four Game Boy shades are the commonly cited DMG screen colours.

The NES is deliberately absent. It has no digital palette at all — the PPU generates an analogue signal, and what you see is whatever a television makes of it. Every emulator ships its own RGB approximation, and they visibly disagree with each other. Any single set of 64 values presented as “the NES palette” is one emulator author's judgement wearing a hardware label. If you have a palette you trust, the .hex and .gpl exports here are the formats to bring it in with once importing lands.

When you need this

Enforcing a palette across an asset pack

Art drawn over months drifts. Extract the palette from your reference sheet, then map every sprite onto it so the pack is provably one set of colours.

Hitting a hardware constraint

Making something for a fantasy console or a jam with a colour limit? Map the art to the target palette and see what survives before the rules bite.

Stealing a palette you like

Drop in a screenshot, read out its colours, export the .gpl and load it into Aseprite. The palette is the part worth taking.

Shrinking a GIF or a texture

Fewer colours means smaller indexed output. Reduce deliberately here and see the result, rather than letting an exporter decide for you.

Export formats

Image: a lossless PNG at the original dimensions, containing only palette colours, with the alpha channel untouched. Fully transparent pixels keep whatever colour was behind them and are not counted or remapped.

Palette: .gpl is the GIMP palette format, which Aseprite, Krita and GrafX2 also read. .hex is one triplet per line — the plainest form, and what Lospec imports. .json is a named list for your own tooling. .png is the swatches drawn as an image, for a reference sheet.

Keeping the colours you chose

A palette survives export and then the importer quietly changes it.

Godot

Set the texture's Filter to Nearest in the import dock. Filtering blends neighbouring pixels at render time and reintroduces colours the palette does not contain.

Unity

Filter Mode Point (no filter) and Compression None. DXT compression works by approximating blocks of colour, which is precisely what a fixed palette is trying to avoid.

Aseprite

Palette → Load Palette, then Sprite → Color Mode → Indexed to lock the sprite to it. Anything you draw afterwards is constrained to the palette.

Frequently asked questions

How do I get the colour palette out of an image?

Drop the image in and the tool counts every distinct colour in it, ordered by how much of the picture each one covers. Pixel art usually comes back with a few dozen; a photograph comes back with thousands. Export the list as a .gpl for Aseprite or GIMP, as a .hex to paste into Lospec, as JSON, or as a swatch PNG.

How do I convert an image to a Game Boy or PICO-8 palette?

Pick the console under Palette and every pixel is snapped to its nearest colour in that palette. The result is a real image you can download, not a filter preview — the exported PNG contains only the palette's colours and nothing else.

What does “by how it looks” versus “by RGB numbers” change?

It changes which palette colour each pixel is judged closest to. Comparing raw RGB numbers treats a step in blue as equal to a step in green, which the eye does not: a mid green has small numbers, so raw comparison calls it dark and sends it to the wrong shade. The perceptual setting measures distance in OKLab, where equal steps look equally different. On a four-colour palette the two settings produce visibly different pictures.

Should I turn dithering on?

For pixel art, no. Every pixel was placed deliberately, and dithering scatters a checker of two palette colours where the artist chose one. It is worth turning on for photographs and smooth gradients, where the alternative is visible banding. The tool offers ordered 4×4 and 8×8 matrices rather than error diffusion, because error diffusion spreads a decision about one pixel across its neighbours — so the pattern changes when a sprite is cropped.

How does reducing to 16 colours choose which 16?

By median cut. Every colour in the image goes into one box; the box with the widest spread is split along its widest channel; that repeats until there are as many boxes as you asked for. Each box then collapses to the pixel-weighted average of the colours inside it, so a colour covering half the image pulls its box towards itself instead of being averaged away.

Why is there no NES palette?

Because there is no such thing as the NES palette. The console generates an analogue signal rather than looking colours up in a table, so every emulator ships its own RGB approximation of what that signal looks like on a television, and they disagree. Shipping one of them unlabelled would be presenting a guess as a fact. The palettes here are the ones with a documented answer.

Are my images uploaded to a server?

No. The image is decoded, counted and recoloured with the Canvas API inside your browser. Nothing leaves your machine, and the tool keeps working offline once the page has loaded.

Related guides

Related tools