Color Palette from Image

Drop an image and extract its dominant colors as a 6-color palette using k-means clustering. Image processing runs entirely in your browser — nothing uploads. Useful for matching a design system to a logo, sampling a photo for a hero image, or building a moodboard palette.

How to use the Color Palette from Image

Pick an image (drag-drop into the file picker works). The tool downsamples it for speed, then runs k-means clustering on the RGB pixel values to find the K most representative colors. Each swatch is clickable to copy the HEX value.

How k-means picks colors

k-means is a clustering algorithm: pick K initial centers, assign each pixel to the nearest center, move each center to the mean of its assigned pixels, repeat. After enough iterations, the centers settle on the K most representative colors in the image.

Variants exist that produce slightly different palettes — median-cut (used by GIF quantization) and octree (used by some image-conversion libraries) — but k-means is the simplest and gives intuitive results. The K parameter controls how many colors come out; 5-8 is usually the sweet spot for design palettes.

Frequently asked questions

How are the colors chosen?

It runs k-means clustering on the image pixels and returns the cluster centers as the dominant colors, so the palette reflects the most visually significant tones.

Is my image uploaded?

No. The image is read and processed entirely in your browser. Nothing is uploaded or stored.

Why does the palette change slightly each run?

k-means starts from random seeds, so cluster centers can shift a little between runs. Re-run it if you want to compare a couple of options.
Embed this tool on your site

Free to embed, no attribution required (but appreciated). Paste this where you want the tool to appear: