Get a colour palette from an image
Pull the palette out of a photo, a logo or a screenshot: the colours that appear most, with codes ready for design, the web or your slides. The image is analysed in your browser and never uploaded.
đź”’ Your files never leave your device
How to use it
- Drop a JPG, PNG or WebP image.
- Choose how many colours you want: 5, 8 or 12.
- Click a colour to copy its HEX code.
- Copy every colour as a list or as CSS variables.
Example
A two-colour logo
For a logo that is three quarters red (#C81E1E) and one quarter blue (#1428DC) on a transparent background, the palette returns exactly those two colours: red at 75% and blue at 25%. The transparent background is ignored.
How it works
It uses the median cut algorithm: pixels are grouped into boxes that are split in half again and again along the channel (red, green or blue) with the most variation, starting with the largest, most varied box.
Each palette colour is the average of the pixels in its box, and the percentage shows how much of the image it covers.
The image is analysed at up to 200 px per side, enough for the palette and much faster. Transparent pixels (alpha below 50%) are ignored.
Limitations
- Colours are group averages: in photos with gradients they may not match any single pixel. For the exact colour of one spot, use your editor’s eyedropper.
- A small but important detail (a button, an accent colour) may not appear if it covers very little of the image; try more colours or crop the image.
FAQ
What is the difference between HEX, RGB and HSL?
They are three ways to write the same colour. HEX (#C81E1E) is the most common on the web and in design tools; RGB gives the red, green and blue amounts from 0 to 255; HSL gives hue, saturation and lightness, handy for making lighter or darker variants.
Is my image uploaded?
No. It is analysed in your browser and never leaves your device.
How do I use the CSS variables?
Paste the :root block into your stylesheet and use the colours with var(--color-1), var(--color-2) and so on.