Image

Color Palette Extractor

Extract the dominant color palette from an image.

Files never leave your device · Processed in your browser

Select an image to see its color palette here.

What is this?

Analyzes the pixels of your uploaded image to pull out the most common representative colors as HEX and RGB codes — all computed in your browser, no upload needed.

How to use it

Pick or drop an image and analysis starts automatically. Choose the number of colors (5, 6, 8, or 10), and click any swatch to copy its HEX code to your clipboard.

How extraction works

The image is downscaled and drawn onto a canvas, then every pixel's RGB value is read and grouped into similar-color buckets via quantization. The most frequent buckets become the representative colors.

Privacy & safety

Loading, analyzing and previewing all happen entirely in your browser — files are never uploaded or stored on a server.

How extraction works — this tool's quantization method

Before drawing your image to canvas, this tool downscales it to a max of 160px on the longer side — a performance optimization that keeps even large photos fast to analyze. It then walks every pixel of the downscaled image (skipping fully transparent ones) and quantizes each R/G/B channel to 16 levels using only the top 4 bits — mapping the 0-255 range into one of 16×16×16=4096 buckets. Pixels in the same bucket are averaged into that bucket's representative color, and the buckets with the most pixels (highest frequency) become the top N colors in the palette. This is a lightweight bit-truncation quantization rather than a more elaborate median-cut or k-means clustering — fast enough to compute instantly in the browser.

Using extracted colors in design — the 60-30-10 rule

When applying extracted colors to an actual design, the 60-30-10 rule from interior and graphic design is a handy guide: allocate 60% to a dominant color (backgrounds, the largest area), 30% to a secondary color (cards, section dividers), and 10% to an accent color (buttons, links — anything that should catch the eye). Since this tool ranks colors by frequency, the top color is the one covering the most area in your image — a natural pick for the 60% dominant slot — mid-ranked colors work well as the 30% secondary, and the most saturated, eye-catching color makes a good 10% accent.

How does color extraction work here?
Your image is downscaled and drawn onto a browser canvas, then every pixel's color is read and grouped into similar-color buckets (quantization). The most frequent buckets become the representative colors.
How many colors can I extract?
You can choose 5, 6, 8, or 10 colors, with 6 as the default. More colors capture finer detail in the image's tones.
What can I use the extracted colors for?
Great for picking logo/brand colors, building web or app design palettes, or matching background and accent colors. Copy the HEX/RGB values straight into CSS or a design tool.
Is my photo uploaded to a server?
No. Loading, analyzing, and previewing all happen in your browser only — nothing is sent or stored on a server.
Exactly how is the palette extracted?
The image is downscaled to a max of 160px on the longer side and drawn to canvas, then every non-transparent pixel's R/G/B channels are quantized to 16 levels using only the top 4 bits (4096 buckets). Each bucket's average RGB becomes its representative color, and the most frequent buckets become the top N colors.
Is there a good way to allocate extracted colors in a design?
The 60-30-10 rule from interior and graphic design works well: 60% dominant color (background), 30% secondary (cards, sections), 10% accent (buttons, links). Using the most frequent color as dominant, mid-ranked ones as secondary, and the most saturated as accent gives a natural result.
How can I confirm my image is never sent to a server?
This tool converts your selected file into a temporary local address with URL.createObjectURL(), valid only inside the browser, for preview and canvas analysis. There is no fetch or XHR call anywhere in the code that transmits the file — you can verify this yourself in your browser's DevTools Network tab.