Extract colour palette
Dominant colours in an image, on your device. Decode only. No image is re-encoded.
Runs on your device. The file is never uploaded.
Extract colour palette groups pixels into buckets keyed on the high 4 bits of each channel, then ranks the buckets by population. It prints the top 5 as hex codes, each with the share of the image it holds. Count accepts 1 to 32. Alpha is never read, so a wide transparent area still votes with the colour underneath it.
Questions
How are the colours chosen?
By bucketing, not by clustering. Each pixel is placed in a bucket using the top 4 bits of its red, green and blue values, the buckets are sorted by how many pixels landed in them, and the top ones are reported as the average colour of their bucket. This is not k-means, so two similar shades can both appear if they fall in different buckets.
What does the percentage next to each colour mean?
The share of the image pixels that fell into that bucket, to one decimal place. The output lists each colour as a hex value followed by its percentage, under a heading naming your file and its pixel dimensions. The percentages will not add up to 100 unless you asked for enough colours to cover every bucket.
How many colours can I ask for?
How many colours to return defaults to 5 and accepts a whole number from 1 to 32. Anything else stops with "count must be a whole number between 1 and 32". If the image has fewer distinct buckets than you asked for, you simply get fewer lines.
Does it handle transparency?
It ignores it. The alpha channel is not read at all, so fully transparent pixels still contribute their underlying red, green and blue to the count. On a PNG with a large transparent area, that hidden colour can dominate the result. Flatten the image first if that matters.
Do I get a swatch image?
No, the output is text only, and no image is re-encoded. Copy the hex values into your own design or code. The file is decoded in a Web Worker on your device with the jSquash codecs and nothing is uploaded. JPG, PNG and WebP are read; anything else stops with "only JPG, PNG and WebP are supported".