Skip to content

Palette Extractor

Pulls an N-colour palette out of an image and exports it as hex, CSS variables or an ASE swatch.

The colours in a picture, as a palette you can paste into a stylesheet. The quantiser is the one the PNG compressor uses, on the reasoning that a palette good enough to represent the image is by definition one that describes it — and the share of the image each colour covers is counted rather than estimated.

🔒 Runs entirely in your browsercolorpaletteextractdesign

Drop an image

The palette comes from the same quantiser the PNG compressor uses — a palette good enough to represent the image is one that describes it.

How to use it

  1. Drop an image

    The bar under the preview shows each colour at its actual share, so a colour that covers 2% of the frame looks like 2%.

  2. Set how many colours you want

    Two to sixteen. Five or six is usually the point where the palette stops being a summary and starts being a list.

  3. Export in the form you need

    CSS custom properties, a Tailwind @theme block, SCSS variables or JSON — copied whole rather than one swatch at a time.

Common questions

Why is a colour I can clearly see not in the palette?

Because it covers too little of the image. The quantiser optimises for representing the whole picture, so a bright accent on 1% of the frame loses to a large area of near-identical greys. Raise the colour count.

Is it sampling the whole image?

A uniform stride over it, about 400,000 pixels. Dominant colours are a property of the distribution so a stride preserves them — and unlike downscaling first, it cannot invent a colour that is not in the picture.

The Tailwind output does not work in my project.

Tailwind 4 defines colours as custom properties inside @theme, which is what this emits. A v3-style module.exports config pasted into a v4 project silently does nothing, and the reverse is also true.

Feed it from

Next

These accept what this tool produces, so the result can go straight in.