Free & private

Image Unique Color Counter

Upload any image and this tool reads every pixel to count exactly how many distinct colors it contains, then shows the most frequent colors as swatches with counts and percentages.

Upload an image

Every pixel is scanned locally.

1600 px

Large images are downscaled to this size before counting so results stay fast. Original dimensions are always shown.

Results

Total colors and the most frequent ones.

Upload a photo to begin
🔢

Exact pixel counting

Every pixel's RGBA value is read directly with canvas getImageData, not estimated or sampled.

🎨

Top colors, ranked

See the most common colors in your image as swatches with hex codes and share of total pixels.

🔒

Private by design

Color counting happens entirely in your browser. Your image is never uploaded to a server.

How to count unique colors in an image

Useful for checking how "flat" or "photographic" an image is, verifying a limited color palette, or exploring an image's composition in detail.

  1. Upload an imageChoose or drop a JPG, PNG or WebP file.
  2. Set the resolution capKeep the default or raise it for more precision on large images.
  3. Count the colorsView the total unique color count and the top color swatches.

How the color count is calculated

The tool draws your image onto an off-screen canvas and reads its raw pixel buffer with getImageData. Every pixel's red, green, blue and alpha values are combined into a single number and tallied in a lookup table, so the final count reflects the exact number of distinct color combinations present.

Why photos have so many colors

Camera sensors, JPEG compression and smooth gradients introduce subtle per-pixel variation, so even a simple photo often contains tens or hundreds of thousands of unique colors.

Flat graphics tell a different story

Logos, icons and screenshots with solid color fills typically contain only a handful to a few hundred unique colors, which this tool makes easy to verify.

Top colors by frequency

Alongside the total count, the tool ranks the most common colors by pixel count so you can see the dominant palette at a glance.

Resolution and accuracy

Analyzing at full resolution gives the most accurate count. For very large images, a lower resolution cap trades some precision for faster results.

Unique color counter FAQ

How does the tool count unique colors?

It reads every pixel's red, green, blue and alpha values using the canvas getImageData API and counts how many times each exact color combination appears.

Why is the unique color count so high for a photo?

Photos captured by cameras and phones rarely use flat colors. Gradients, noise and compression artifacts mean a single photo can easily contain hundreds of thousands of subtly different colors.

Why does a large image get analyzed at a lower resolution?

Very large images have millions of pixels, which can be slow to scan in a browser. The tool can downscale huge images to a size you choose before counting so results stay fast, and the original dimensions are always shown for reference.

Is my photo uploaded to a server?

No. Every pixel is read and counted locally in your browser using canvas. Nothing is uploaded.