Colour Palette from Image

🔒 Runs in your browser — files are never uploaded

Pull the dominant colours out of a photo, logo or screenshot. Click any swatch to copy its hex code, or download the whole palette as CSS variables.

How it works
  • Select any image — a photo, a logo, a screenshot of a design you like.
  • Choose how many colours you want. Eight suits most palettes; five for something tighter.
  • Click a swatch to copy its hex, or download the set as CSS variables or JSON.

How the colours are chosen

Naively counting the most frequent pixels gives a poor result — you get eight barely-distinguishable shades of whatever dominates the background. This uses median cut, the classic quantisation approach: it treats every pixel as a point in colour space, repeatedly splits the fullest region along its widest axis, and averages what falls in each box.

The effect is a palette that spans the image rather than clustering. A photo of a sunset gives you the orange, the deep blue and the silhouette — not six oranges. The percentage under each swatch shows how much of the image that colour accounts for, so you can tell a dominant tone from an accent.

What it's useful for

  • Building a brand palette from a logo when nobody wrote the hex codes down — which is most of the time.
  • Matching a design to a photograph, so a page and its hero image feel like one thing.
  • Recovering colours from a screenshot of a site or app you want to reference.
  • Choosing chart colours that sit correctly against an image-heavy page.
Extracted colours are a starting point, not a finished palette. Colours pulled from a photo are often too similar in lightness to use as text on background — check the contrast before you ship anything. A palette usually needs a near-black and a near-white added by hand, and those rarely come out of a photograph.

Getting a better result

Crop before you extract. If you only care about a product's colours, crop out the background first — otherwise a large white studio backdrop dominates the palette and you get five whites. The crop tool takes a few seconds and changes the output completely.

Transparent areas are skipped rather than counted as white or black, so logos on transparency give sensible results. Very small images give rougher palettes simply because there are fewer pixels to sample.

Frequently asked questions

How do I get the hex code of a colour in an image?
Select the image and the dominant colours appear as swatches with their hex codes. Click any swatch to copy it.
How are the colours chosen?
By median cut quantisation, which splits colour space rather than just counting frequent pixels. That gives a palette spanning the whole image instead of several near-identical shades of the background.
What does the percentage under each colour mean?
How much of the sampled image that colour accounts for — useful for telling a dominant tone from an accent.
Can I use these colours straight in a design?
As a starting point. Colours pulled from a photo are often too close in lightness to pair as text and background, so check contrast, and expect to add a near-black and near-white by hand.
My palette is mostly white. Why?
The background is dominating. Crop to the part you care about first and extract again — it changes the result completely.
What about transparent images?
Transparent pixels are skipped rather than counted as white, so logos on transparency give sensible palettes.
Is anything uploaded?
No. Every one of these runs in JavaScript in your browser — nothing is sent to a server. Load the page, disconnect from the internet, and it still works.