Extract a Color Palette from an Image
Load a picture and pull out its dominant colors as HEX swatches you can copy — computed entirely on your device.
Image Palette Extractor
- k-meansPixels are grouped into clusters by perceived similarity; each swatch is a cluster's average colour and its share of the image.
- OKLabClustering happens in OKLab (Ottosson, 2020), a perceptual colour space — so two swatches that look alike are merged, unlike plain RGB averaging.
- ContrastEach swatch shows whether white or black text reads better on it, using WCAG 2.2 contrast ratios.
Runs in your browser — nothing you enter is uploaded or stored.
Scratchpad auto-saved
About the Image Palette Extractor
A color palette is the handful of colors that define an image's look. This tool extracts them automatically: it shrinks the picture to a small thumbnail for speed, reads every pixel with getImageData, and groups similar colors into buckets by rounding each channel. The most populated buckets are the dominant colors, and each swatch shows the average color of its bucket for an accurate result.
Pick how many colors you want — 6, 8, or 10 — and the swatches update, most-common first, each labelled with its HEX code. Click any swatch to copy that HEX to your clipboard for use in CSS, a design tool, or a brand guide.
Fully transparent pixels are ignored so they do not skew the results. Everything is computed in your browser, so you can pull palettes from private mockups, photos, and brand assets without uploading anything.