Free tool · nothing is uploaded

Colour palette extractor

Pull the colours out of any photograph, weighted by how much of the frame each one actually occupies — then copy them as hex, CSS variables, a Tailwind fragment or JSON.

Dominance, not decoration

Most palette generators hand back evenly-spaced swatches, which answers the question “which colours appear here?” That is rarely the useful question. A photograph is not a set of colours, it is a distribution of them: a landscape may contain a hundred hues while being, in practice, blue.

So the strip above is proportional. A swatch covering a fifth of the width covers roughly a fifth of the photograph. That is what makes it usable as a colour brief — you can see at a glance whether a look is carried by a dominant mass with one accent, or by two colours in tension.

How median cut works

Every pixel starts in one box. The algorithm finds whichever colour channel varies most across that box, sorts by it, and splits at the middle — turning one box into two, each holding half the pixels. Repeat, and after four passes there are sixteen boxes, each one a cluster of colours that genuinely sit near each other.

Averaging each box gives the palette. Because every split is by pixel count rather than by colour distance, the result is weighted toward what the image is mostly made of, which is exactly the property the proportional strip depends on.

Frequently asked questions

How are the colours chosen?

By median cut. The image is downsampled, every pixel is placed in one bucket, and that bucket is repeatedly split along whichever colour channel currently varies most. What comes back is the average of each final bucket, ordered by how many pixels it holds — so the palette describes the whole frame rather than a handful of points somebody clicked.

Why are the swatches different widths?

The strip is proportional. Each colour's width is its actual share of the image, so a photograph that is four-fifths sky reads as four-fifths blue. An evenly-spaced palette would tell you which colours are present; this tells you which ones the photograph is actually made of.

Is this the same palette RawCut shows on community posts?

Yes, literally the same code. The Color-DNA strip under every published edit runs the identical median-cut pass, so a palette pulled here matches what the site would show for that image. It is one measurement, not two implementations that drift apart.

Can I get more than eight colours?

Up to ten. Median cut halves each bucket per pass, so the number of passes sets the ceiling — the tool raises the depth to match the count you ask for rather than silently returning fewer colours than requested.

Does it upload my photo?

No. The file is read with the browser's File API and drawn to a canvas on your own device. Nothing is transmitted, which also means very large files are limited only by your own machine.

Why does the palette miss a colour I can clearly see?

Median cut allocates buckets by pixel count, so a small but vivid accent — a red jacket in a wide landscape — can be merged into a larger neighbouring bucket. Raising the colour count usually separates it. This is the trade-off of any dominance-based method: it reports what covers the most area, not what draws the eye.

Related tools