Extract a Color Palette From an Image
Drop in an image and get a compact palette of its dominant colors as HEX values. The tool downscales the picture inside your browser, groups nearby RGB values into practical color bins, and shows the strongest swatches with a copy-ready list. It is useful for a starting point in a presentation, illustration, website theme, or moodboard. It is not a perceptual brand-system generator and does not upload the image to a palette service.
Use this without the search next time. Prathom Workbench puts Prathom's tools in your toolbar.
Add to Chrome — freeWhat it does
- Extract six dominant palette swatches
- Return copy-ready HEX values
- Downscale large images before sampling
- Show sample counts to explain the ranking
- Run locally with no image upload
How to use Image Palette Generator
- 1
Choose the image
Drop in a photo, illustration, screenshot, or reference image. The browser creates a small working copy for sampling rather than processing the original at full size.
- 2
Review the swatches
Inspect the six ranked colors and their sample counts. The strongest color is common in the sampled pixels, not necessarily the color your eye considers the subject.
- 3
Copy the palette
Copy the HEX list into a design note, CSS draft, moodboard, or token planning document.
- 4
Validate the design
Check contrast, brand rules, and real use cases separately before treating an extracted palette as a final accessible theme.
How it works
The image is first drawn into a canvas no wider than 240 pixels. That reduces the number of samples dramatically while preserving the broad color distribution that makes a palette useful. The extractor visits every sixteenth byte position in the resulting RGBA buffer, rounds each red, green, and blue channel into a sixteen-level bin, and increments that bin's count. The six most frequent bins are converted back into representative HEX values.
Quantization is intentionally visible in the description. Two near-identical green pixels do not need separate swatches for a practical moodboard, while a more sophisticated algorithm might choose colors based on perceptual distance or contrast. The returned counts show why a color ranked where it did, and the result is deterministic for the same decoded image.
Turning a palette into a design
Use the output as reconnaissance: identify a background family, primary accent, dark text tone, muted surface, and optional highlight. Then name semantic roles rather than scattering raw HEX strings throughout a codebase. The image does not tell you whether a color is safe for text, whether it survives dark mode, or whether it fits a brand guideline.
Crop and rerun when the image contains multiple unrelated scenes. A whole photograph may describe its sky and ground, while the subject's meaningful accent disappears into the frequency count. Comparing the full-image palette with a subject crop is often more useful than asking one algorithm to decide what the image means.
Frequency is not importance
The extractor counts pixels, and counting pixels answers a different question from the one you are usually asking.
The color that occupies the most area is generally the background — a wall, a sky, a studio backdrop — and it will lead the palette every time. The color that makes the image memorable is often a small bright accent covering two percent of the frame: a logo, a piece of clothing, a single lit object. By area it is nowhere; by attention it is the whole point.
So read the six swatches as "what this image is mostly made of", which is genuinely useful for choosing a background and a muted surface, and not as "the six colors that matter here". If the accent you wanted is missing, it is not a failure of the extraction — it is the correct answer to the question the extractor asks.
Two habits fix it. Crop to the region that carries the accent and run it again, then combine the two results by hand. And use the counts: a color with a small count that still made the top six is unusual enough to be doing real work, and is often the one worth keeping.
Why the swatches look flatter than the photograph
Each channel is rounded into sixteen levels before counting, which means the palette is quantized to a grid of 4,096 possible colors rather than the 16.7 million the image can contain.
That is what makes the counting meaningful. Without it, a photograph of a blue sky produces several thousand nearly-identical blues, each with a count of one, and there is no most-frequent color to find. Binning collapses those into a single bucket that genuinely represents the sky.
The cost is that the reported HEX is the center of a bin rather than a color necessarily present in the image. A sky whose true dominant tone is #6FA8DC may be reported a step or two away, and gradients — sunsets, soft studio lighting — are where the difference is most visible, because the actual color is a smooth range and any single value misrepresents it.
For a moodboard or a starting point, this does not matter. For matching an exact color — sampling a brand tone out of a screenshot, say — do not use a palette extractor at all. Use a picker on the specific pixel you mean, where you are choosing the sample rather than letting an average choose for you.
Examples
A dark forest photograph
The list captures broad visual mass. A small bright flower may be important to the composition but still rank below colors occupying most of the image.
A product screenshot
Screenshot palettes are useful for spotting an existing UI color language before rebuilding it as CSS variables, but they still need a contrast and semantic-role pass.
Frequently asked questions
How are dominant colors selected?
The image is drawn into a small canvas and sampled at regular intervals. Each RGB channel is grouped into sixteen broad levels, nearby pixels share a bin, and the most frequent bins become the six swatches. This is fast and explainable, but it is not the same as a perceptual clustering algorithm or an artistic judgment about which colors matter.
Why is an important small color missing?
Ranking follows pixel frequency, so a tiny logo, flower, highlight, or accent can occupy too few sampled pixels to reach the top six. Crop the image around that detail and run it separately, or choose the accent manually with the color picker. A dominant palette is a starting point, not a complete inventory.
Does the tool upload my image?
No. The image is decoded by the browser, drawn to a small in-memory canvas, sampled, and then released. Only the six displayed color strings remain in the page state. The source image is not posted to a server, which makes this suitable for internal screenshots and unreleased creative work.
Are the colors ready for accessible UI design?
Not automatically. The palette describes colors found in the image; it does not assign foreground and background roles or calculate WCAG contrast. Before using a swatch for text, links, controls, or focus indicators, pair it with the actual surface and test the contrast and non-color cues.
Further reading
- Cutting a Graphic to Sixteen Colors Saved Fourteen Per CentReducing the palette is standard advice for shrinking a PNG, and on a graphic that is already flat color it buys far less than the drastic-sounding change suggests. The reason is that PNG was already exploiting the same redundancy, and it had got there first.
- Six Ways to Shrink an Image, and What Each One CostsEvery image editor has a dropdown of resampling filters with names like Bicubic, Lanczos and Nearest Neighbor, and almost nobody changes it. The differences between them are real, they are measurable, and which one is right depends on what is in the picture rather than on which sounds most advanced.