(01) — TOOLS
Five dominant colours.
Drop a photo. k-means on a pixel sample yields up to five hues, ranked by area. Nothing is sent.
Preview
Palette
At a glance
- 5-colour dominant extractor, free, in the browser.
- RGB k-means on a sample (long edge ≤ 160 px). JPEG, PNG, WebP, GIF.
- Swatches ranked by area, copyable HEX, CSS variables.
- The image is never sent to a server.
(02) — METHOD
Sample, cluster, rank.
01 — Image
JPEG, PNG, WebP, GIF (first frame). The long edge is capped at 160 px so it stays snappy.
02 — K-means
Opaque pixels are grouped into 5 RGB clusters. Each centroid is a swatch.
03 — Rank
Swatches are ordered by pixel count. A flat photo yields one.
(03) — FAQ
Short answers.
- Why not the exact pixels?
- A photo has thousands of hues. k-means merges neighbours. It is a useful palette, not an exact histogram.
- Does the image leave the device?
- No. It is read in a canvas, never posted.
- SVG, HEIC?
- No. Stick to JPEG, PNG, WebP or GIF. HEIC is not decoded everywhere.