Extract the main colors of a photo
A good palette usually starts from a photo: a sunset for a website theme, a product shot for brand colors, a painting for a room’s decor. This tool reads your image and gives you its dominant colors as a row of swatches, each with its HEX, RGB and HSL code and the share of the image it represents.
The palette is ready as soon as the image opens, and it updates instantly when you change a setting. A bar under the image shows the colors in proportion to how much space they take, so you can see at a glance which tones dominate.
How the palette is computed
The tool reads up to 20,000 evenly spaced pixels from the image (mostly transparent ones are skipped) and runs the median cut algorithm on them:
- All sampled colors start in one group.
- The group with the widest spread on red, green or blue is sorted on that channel and cut in half at the median.
- This repeats until there are as many groups as colors you asked for.
- Each group’s average becomes one palette color.
Because each cut happens at the median, the palette follows how much of the image each color covers: a photo that is mostly blue sky gets several shades of blue. A flat graphic with only a few colors may return fewer swatches than requested, since identical colors can’t be split further.
Settings
| Setting | Options |
|---|---|
| Number of colors | 3 to 12 (6 by default) |
| Order | Most common first, Dark to light, or By hue (rainbow order, with grays at the end) |
Copy, export and save
- Click a swatch to copy its HEX code.
- Copy HEX list —
#1d3557, #457b9d, …for design apps and color tools. - Copy CSS variables — a
:root { --color-1: …; }block to paste into a stylesheet. - Copy JSON — an array of HEX strings for code or design tokens.
- Download palette (PNG) — an image with one 240-pixel-wide color bar per swatch and its HEX code underneath, handy for mood boards and sharing.
Tips
- Want one exact color rather than an average? Use the Image Color Picker and click the spot.
- Crop first if you want the palette of one object: the whole image is analyzed, so a large background will take several swatches.
- Turn the palette into art: Image to Pixel Art redraws a photo using a limited palette built the same way.
- Recolor the photo with one of the palette colors in Change Image Color.
Private by design
The image is decoded and analyzed by your browser — JPG, PNG, WebP, AVIF, GIF, BMP, SVG and iPhone HEIC photos all work — and nothing is uploaded. The page keeps working offline once it has loaded, and the palette PNG contains only the color bars, never any part of your photo or its metadata.