Color Palette from Image
Extract the dominant colors from an image in your browser. Swatches with hex codes, copy to clipboard, no upload.
What this palette extractor does
Choose an image and this page samples its pixels, counts the color values it finds and shows the six most frequent as swatches with their hex codes. Each swatch has a copy button, so a palette can move straight into a stylesheet or a design file.
What the result means
The count is over exact color values, with a sampling step so that a large photograph does not have to be scanned pixel by pixel. A photograph contains thousands of near-identical shades, so the six you see are the most common values rather than a designer's reduced palette; flat graphics, logos, screenshots and illustrations give the cleanest result because their colors repeat exactly.
Why it runs in your browser
The image is decoded into a canvas on this page and every read happens locally. Nothing is uploaded, the tool works offline after the page loads, and closing the tab discards the picture and the palette with it.
Drop an image onto this page and it reports up to six colours, each shown as a swatch with its hex code and a copy button, taken from the pixels the image actually contains.
The method is a frequency count, not a clustering algorithm: the image is drawn to a canvas, roughly four thousand pixels are sampled across it, and every exact hex value is counted. The six most frequent exact values are what you see.
Because the count is over exact values, a photograph with gradients usually produces several near-identical greys rather than six distinct hues. It is a faithful reading of the pixels and a poor a-priori palette.
How the sample is taken
The canvas is the image's natural size and the sampling stride is one step per four thousandth of the pixel buffer, rounded to whole pixels. A small icon and a large photograph are both sampled about four thousand times.
No quantisation is applied before counting. Two pixels that differ by one in the blue channel are two different entries, which is why near-duplicates can fill the list.
The swatches are ordered by count, descending, and the first six are shown. Each copy button puts the `#rrggbb` string on the clipboard.
- Sampling: about 4 000 pixels across the whole image
- Counting: exact hex values, no quantisation
- Output: the six most frequent values
When the answer looks wrong
A large flat background dominates the count, so a logo on a white field usually returns white first. Crop to the subject if you want the subject's colours.
Anti-aliased edges and JPEG artefacts create many one-off colours. They will not appear in a six-entry list, but they do push genuinely repeated colours down the ranking.
How to use the image drop
Drop the image onto the Upload Image panel. The page samples roughly four thousand pixels across a canvas copy and counts exact hex values, reporting the six most frequent.
Copy any colour with its Copy button. A gradient photograph yields near-identical greys rather than six distinct hues, a faithful pixel reading rather than a designed palette, and everything runs in the tab.
What to Expect
Best for
- Reading the dominant colours out of a logo or a flat illustration
- Getting a hex value to match an existing brand image
- Checking what a photograph's background tone actually is
Not ideal for
- A designer palette with distinct, balanced hues, which needs clustering this page does not do
- Gradient-heavy images, where near-duplicates fill the list
- Reading a specific pixel's colour, since the sample skips most pixels
What this tool keeps
- Six exact `#rrggbb` values in frequency order
- The full-resolution image, which is used for the sample rather than a thumbnail
- A copy button per swatch
What may need cleanup
- Near-duplicate entries that look the same on screen
- A dominant background colour that drowns the subject
- A palette that needs reducing to four usable brand colours by hand
Common errors
- Reading the six swatches as a designed palette rather than a frequency list
- Expecting alpha to be reported, when only RGB is counted
- Uploading a file the browser cannot decode and seeing no swatches at all
Example use cases
- Pulling the exact hex of a logo background
- Checking a screenshot's most common fill colour
- Sampling a photograph before choosing a page accent
Sample input
A 1200 by 800 photograph of a red kite against a pale blue sky.
Sample output
Six swatches led by a pale blue and two near-identical sky tones, with the kite's red appearing further down.
Who this is for
- Designers matching a colour from an existing image
- Developers extracting a value from a screenshot
- Anyone who needs a hex code rather than a colour name
Frequently asked questions
How many colours does the extractor report?
Up to six colours from the pixels the image actually contains, each as a swatch with a hex code and a copy button.
Does it build a designer palette with balanced hues?
No. It samples pixel frequency rather than clustering, so near-duplicates can fill the list and a dominant background can drown the subject.
Can I read the colour of a specific pixel?
Not exactly. The sample skips most pixels, so a swatch is a frequent colour rather than the pixel you pointed at.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.