Image Color Counter

Count every unique RGB colour in a PNG, JPG, WebP or GIF and list the most common ones with hex codes and pixel counts — exact, not estimated.

🔒 Colors are counted in your browser — nothing is uploaded.

Drop an image here or click to choose

Count every unique color in an image

Upload a PNG, JPG, WebP, or GIF and this tool reads every pixel to report exactly how many distinct RGB colors it contains, then lists the most common ones — as many as you set in Colors to list — with their codes, pixel counts and shares. It is handy for checking whether an image fits an indexed palette, auditing an icon or logo before exporting, estimating file complexity, or grabbing the dominant colors for a design system.

How the counting works

Each pixel's red, green, and blue channels are combined into a single color key, and identical colors are tallied together. Fully transparent pixels are ignored so empty areas never show up as a false black. The result is exact — not an estimate — because every pixel is inspected. Codes are written in hex unless you pick RGB, HSL, HSV or OKLCH under Write colors as, and each row's copy button copies the code as it is written. A table above the list gives the total pixel count and splits it into opaque, semi-transparent, fully transparent and gray pixels, and Copy report or Download report (.txt) takes the whole tally away as text that pastes into a spreadsheet.

Ordering, grouping and naming the colors

Order sorts the listed colors most used first, as a rainbow either way, or lightest or darkest first, without changing which colors make the list, and the report follows it. Similar shades merges near-identical colors — very close, similar or broadly — into one row shown as their average, with how many exact colors went into it, while the count at the top stays exact; clicking a merged row marks every pixel of the group. Show color names puts the nearest CSS color name beside each code. No picture to hand? Sample draws an example to try it on. And when the picture is pixel art enlarged into equal blocks, a line under its size says so, names the block size and gives the art’s true size in pixels; a photograph, a picture of one flat color, or art with a pixel off its grid gets no such line.

Frequently asked questions

Is my image uploaded to a server?

No. The image is decoded and analyzed entirely in your browser using the canvas API. Nothing is sent anywhere and nothing is stored.

Does it count transparent pixels?

Fully transparent pixels (alpha 0) are skipped so they don't register as black. Semi-transparent pixels are counted by their RGB value.

Why do photos have so many unique colors?

Photographs and lossy JPEGs contain subtle gradients and compression noise, so almost every pixel is slightly different — tens of thousands of unique colors is normal. Flat graphics and icons have far fewer.

Can I list more colors, write them as RGB or HSL, and take the tally away?

Yes. “Colors to list” sets how many of the most used colors are shown, and “Write colors as” switches every code — and what each row’s Copy button copies — between HEX, RGB, HSL, HSV and OKLCH. A table above the list gives the total pixel count and splits it into opaque, semi-transparent, fully transparent and gray pixels. “Copy report” and “Download report (.txt)” hand over the whole tally — file, pixel counts, the breakdown and each listed color with its share — as text that pastes into a spreadsheet.

Can I sort the colors by hue, group near-identical shades, or see color names?

Yes. Order lists them Most used first (the default), Rainbow, Rainbow, reversed, Lightest first or Darkest first; it reorders the listed colors without changing which make the list, and the report follows. Rainbow runs red to violet by hue with the grays after, and lightness is judged by OKLCH, so pure yellow sorts far lighter than pure blue. Similar shades merges very close, similar or broadly similar colors into one row, shown as the group’s average with how many exact colors went into it, while the count of different colors stays exact; clicking a merged row marks every pixel of the group. Show color names adds the nearest CSS color name beside each code, marked ≈ unless it is exact, and as a last column of the report.

Can it tell a scaled-up piece of pixel art from a photograph?

Yes. When every pixel of the art has been enlarged into an equal block, a line under the picture’s size says so, names the block size and gives the art’s true size in pixels. It checks every row and column, so a photograph, a picture of one flat color, or art with a single pixel off the grid gets no such line. The color count is the same either way, since a block of one color is still one color.