Color Palette Extractor
Upload a photo, logo or screenshot and get its main colours as HEX, RGB and HSL codes. Click anywhere on the image to sample a single point.
How to use the Color Palette Extractor
- 1Add an image.
- 2Choose how many colours you want in the palette.
- 3Copy any colour code, or copy the whole palette as CSS variables, a Tailwind theme or JSON.
- 4Click a point on the image to read the colour at that spot.
How it works
The image is scaled down and read pixel by pixel in your browser. Similar pixels are grouped into buckets — 32,768 of them, five bits per colour channel — so a photo with millions of pixels becomes a few thousand weighted colours that can be analysed instantly.
Those colours are clustered with k-means in CIELAB colour space. Distance in CIELAB matches how different two colours look to the eye far more closely than distance in RGB, so the palette favours colours that are visibly distinct rather than several near-identical shades of one background.
The starting points are chosen deterministically — the most common colour first, then whichever colour is furthest from those already chosen — so the same image always gives the same palette. A colour's share is the proportion of the image's opaque pixels closest to it; transparent pixels are ignored.
Each colour also shows whether white or black text reads better on top of it, with the WCAG contrast ratio, which helps when turning a palette into a design.