Free tool · Design and colour
Extract color palette from image
Choose a photo and get its main colors, each with its share of the picture and its HEX, RGB and HSL codes. Click the picture to read any single pixel.
- Free
- No sign-up
- Runs in your browser
- #a8dadc54%rgb(168, 218, 220)hsl(182, 43%, 76%)
- #1d355721%rgb(29, 53, 87)hsl(215, 50%, 23%)
- #457b9d19%rgb(69, 123, 157)hsl(203, 39%, 44%)
- #e639463%rgb(230, 57, 70)hsl(355, 78%, 56%)
- #f1faee2.4%rgb(241, 250, 238)hsl(105, 55%, 96%)
- Median cut, refined by k-means
- Example: choose a photo to see yours
- Colors found
- 5
- Pixels analyzed
- 7,500 (of a 100 x 75 px copy)
- Picture
- 4,000 x 3,000 px
How to use the Palette from Image
- Choose a photo or logo under Photo. The palette appears in the result card.
- Pick How many colors?: 5, 6, 8 or 10. A new count updates the palette at once.
- Press Copy HEX, Copy RGB or Copy HSL on a color, or Copy all HEX for the whole list.
- Click or tap the picture to read the exact color of one pixel. Download palette PNG saves the colors as a strip.
How do I get the colors from an image?
The tool works on a copy of your picture shrunk to at most 200 pixels on its long side, which is plenty to find the main colors and keeps it fast on a phone. Pixels that are mostly transparent are ignored. The remaining colors are grouped into small bins, and then the group with the widest spread of color is split in two at its middle pixel, again and again, until there are as many groups as you asked for. This is called median cut. Five rounds of k-means follow: each color moves to the average of the pixels closest to it, so the final colors sit in the middle of what they stand for.
Each color comes with its share, the part of the picture whose pixels are closest to it. In the example picture on this page, a flat landscape, the sky is #a8dadc at 54%, the dark hill #1d3557 at 21%, the lighter hill #457b9d at 19%, the sun #e63946 at 3% and the cloud #f1faee at 2.4%. The sun covers only 3% and still gets its own color, because the method splits where the pixels differ most, not only where there are most of them.
How do I get the HEX or RGB code of a pixel?
Click or tap the picture. A ring marks the spot and the color of that one pixel appears under the picture, with its HEX, RGB and HSL codes and copy buttons. The three codes are the same color written three ways. RGB gives the red, green and blue amounts from 0 to 255, so the dark blue in the example is rgb(29, 53, 87). HEX writes each of those amounts as two hexadecimal digits: 29 is 1d, 53 is 35 and 87 is 57, which gives #1d3557. HSL gives hue, saturation and lightness: the same blue is hsl(215, 50%, 23%), a hue of 215 degrees on the color wheel, half saturated, 23% light.
Which one to use depends on where the color goes. HEX is the usual choice in CSS and design tools, RGB suits code that mixes colors, and HSL is the easiest to adjust by hand, because making a color lighter or less saturated is one number. Photos have noise, so two neighboring pixels of what looks like one color can differ a little. Click a few spots, or use the palette, which averages many pixels.
How many colors should a palette have, and can I use a logo?
Five or six colors describe most photos, and 8 or 10 show more of the minor tones. A design palette is usually shorter than that, so choose the few that matter after you see the shares. If a picture has fewer distinct colors than you ask for, the tool returns only the ones it finds and says so.
A logo or flat illustration works well, because its colors are exact: the palette shows the real brand colors. The soft edges where one color blends into the next add a few in-between colors with a very small share, which you can ignore. A photograph gives averaged colors that appear in the picture as a family of similar pixels rather than a single exact value. The colors are the tool's own result for the picture you choose, so they can differ from those another tool reports with a different method.
Use it with
- Crop Image: crop with preset ratios.
- PNG to JPG: convert PNG to JPG.
- Resize Image to KB: hit an exact file size like 50 KB.
Questions
How many colors can I extract?
Choose 5, 6, 8 or 10. If the picture has fewer distinct colors, only those are returned and the page says how many were found.
What does the percentage next to each color mean?
It is the share of the picture's pixels that are closest to that color. The shares add up to 100%.
How do I get the HEX code of one pixel?
Click or tap that spot in the picture. The exact pixel color appears below it as HEX, RGB and HSL, each with a copy button.
Can I extract the colors of a logo?
Yes. Flat colors come out exact. Anti-aliased edges add a few blended colors with tiny shares that you can ignore.
Are transparent areas counted?
No. Pixels that are mostly transparent are skipped, and the facts line says how many were skipped.
Is my image uploaded?
No. The colors are worked out in your browser, so the image stays on your device.
How this page was made: the tool's results are computed in your browser by the code on this page; the explanations were drafted with AI help and checked against the tool's own output.