Count unique colors in an image

Count the exact number of distinct colors (RGBA) present in an image.

Example:
Drag and drop an image here, or click to choose

How it works

Need to check whether an image respects a limited palette (for example for a GIF export or a 256-color video game sprite), or simply estimate the chromatic complexity of a photo? The tool scans every pixel of the image and counts the number of distinct red/green/blue/alpha combinations encountered.

Why does the result sometimes show "sampling-based analysis: yes"?

For very large images (more than 2 million pixels), the tool analyzes every Nth pixel at regular intervals rather than the entire image, in order to stay fast in the browser. The resulting number remains a good estimate, but not an exact count in that case.

Do two pixels with visually identical color but different transparency count as a single color?

No, the count takes all four channels into account (red, green, blue, and alpha/transparency): two pixels with the same RGB color but different transparency are considered two distinct colors.

100% local processing: the calculation happens in your browser via our WebAssembly module — your image is never sent to a server.