How to use the Colour Palette from Image
- Drop an image on the box or click it to choose a file.
- Choose how many colours you want, from 2 to 12.
- Click a tile to copy its hex code, or copy the whole list as CSS variables.
- Try a different number of colours if the result is too coarse or too busy.
How the colours are found
The tool uses a method called median cut. It collects the colours in the picture, finds the colour channel (red, green or blue) with the widest spread, splits the group in two at the middle of the pixels, and repeats until it has the number of groups you asked for. Each group becomes one tile, coloured with the average of its pixels.
A tiny example: a picture of 100 red pixels and 50 blue pixels with 2 colours asked for gives #ff0000 at 67 percent and #0000ff at 33 percent. Fully transparent pixels are ignored, and the picture is shrunk before reading so large files stay fast.
Getting a useful palette
Photos with a large plain area, such as sky, give that area a big share, and small accent colours can be merged into a neighbour. Ask for more colours to see them.
The result describes the pixels, not the design. For a brand palette, treat the tiles as suggestions and pick the ones with enough contrast against your text colour.
Frequently asked questions
Is my picture uploaded?
No. The file is read by your browser and drawn to a canvas on your device; nothing is sent over the network.
Why are the colours slightly different from what I see?
Each tile is the average of a group of similar pixels, so it may not be a colour that exists exactly in the picture.
Which image types work?
Any type your browser can show, usually JPG, PNG, WebP, GIF and SVG.
Will I get the same result every time?
Yes. The method has no random step, so the same picture and colour count give the same palette.
Sources
- Wikipedia: Median cut (as of November 2026)
Last reviewed