How to get a colour palette from an image
- Choose an image, or try the sample sunset.
- Move the Number of colours slider to get a broader or more detailed palette.
- Click any point on the image to read that exact pixel. Add it to the palette if you want to keep it.
- Copy a HEX or RGB value, or export the palette as an image, JSON data or CSS custom properties.
Uses
- Matching social graphics and thumbnails to a product photo.
- Pulling brand colours from a logo for a website theme.
- Building a mood board palette from a reference shot.
How the colours are calculated
The image is scaled down to about 200 px on its longest side and the colours are grouped with a k-means clustering algorithm. Each palette colour is the average of one group, and the percentage shows how much of the image the group covers. Results are a good guide, but they are approximate: two similar shades may merge, and small accents can be missed. Sample the pixel directly when you need a specific spot.
- Transparency: fully transparent pixels are ignored. Partly transparent pixels count in proportion to their opacity and use their own colour, not blended with any background.
- Colour space: values are sRGB as decoded by your browser. Images with other colour profiles are converted to sRGB first.
- Print: screen colours are not a reliable match for printed ink. Use a proper colour-managed workflow and physical swatches for print work.
- Sampling: point sampling reads the full-resolution image (up to 4096 px on the longest side), no matter how small it appears on screen.
Export formats
| Format | Contents |
|---|---|
| PNG | Swatches with HEX labels, ready to share. |
| JSON | HEX, RGB and share for each colour. |
| CSS | :root custom properties such as --palette-1. |
Frequently asked questions
How are the colours chosen?
The tool groups similar pixels and ranks the groups by how much of the image they cover, so the palette reflects the photo's main colours.
Can I pick an exact colour?
Yes. Click or tap anywhere on the image, or move the picker with the arrow keys, to sample a single pixel.
What formats can I export?
A palette image (PNG), JSON with HEX and RGB values, or CSS custom properties ready to paste into a stylesheet.