Palette Converter

Reduce any image to a tight 2–32 color palette right in your browser using median-cut quantization. Pull out the palette, pixelate for a chunkier look, and export a reduced PNG, a GIMP .gpl, or a plain .hex list. It's free and nothing uploads — the whole thing runs on your device.

BEFORE — sample
AFTER — 16 colors
Extracted palette — click a swatch to copy its hex

Showing a built-in sample so you can see the reducer working. Drop your own image on the left to convert it — everything stays on your device.

How to use the Palette Converter

  1. Load an image — click the drop zone or drag a PNG, JPG, GIF or WEBP onto it. A sample is loaded so you can see the before/after instantly.
  2. Drag the Colors slider to pick how many colors to keep, anywhere from 2 to 32. The after preview and palette update live.
  3. Turn on Pixelate / downsample and raise Pixel size to block-average the image first — great for a chunky, retro pixel-art feel.
  4. Click any palette swatch to copy its hex, or grab the whole set with Copy hex.
  5. Export a Reduced PNG at full resolution, a GIMP .GPL palette, or a plain .hex list for use in your editor.

How the color reducer works

Under the hood this is a real median-cut color quantizer. It samples pixels from your image into a color histogram, wraps them in a box, and repeatedly splits the box with the largest red, green or blue range at its median value. Each final box is averaged into one palette color, and every pixel is mapped to its nearest match by squared RGB distance. That's the same family of algorithm GIF encoders have used for decades, and it produces a palette that tracks the image's actual colors rather than a fixed swatch set.

To stay fast, the quantizer works on a copy of the image scaled to about 256px on its long edge, then the reduced result is scaled back up with nearest-neighbor so edges stay crisp instead of blurring. The downloaded PNG is rendered at the image's full natural resolution. Whether you're building a limited-palette sprite, matching a game's color budget, or extracting a GIMP GPL palette to paint with, the workflow is the same: load, slide, export.

What is median-cut color quantization?

Median cut builds a box around all the colors in your image, repeatedly splits it along the widest color channel at the median, then averages each box to one representative color. The result is a balanced palette that follows your image's real color distribution instead of picking colors at random.

Does my image get uploaded to a server?

No. Decoding, quantizing and exporting all run locally in your browser with the Canvas API. Your image never leaves your device, so the tool works offline and keeps your files private.

What is a .GPL file and where do I use it?

A .gpl file is a GIMP palette — a plain-text list of RGB values and hex codes. Drop it into GIMP's palettes folder, or import it into editors like Krita and Aseprite, to paint with the exact colors extracted from your image.

How many colors should I reduce to?

For a clean pixel-art or poster look, 8 to 16 colors usually reads best. Drop to 2–4 for bold, graphic results, or push to 24–32 to keep subtle gradients while still shrinking the palette.