What Is a Unique Color Counter?
A unique color counter scans an image pixel by pixel and counts how many distinct colours it contains. Two pixels count as the same colour only if their red, green and blue values match exactly. A simple logo may use a handful of colours, while a detailed photograph often contains hundreds of thousands of subtly different shades out of the 16,777,216 possible 24-bit colours.
Knowing the colour count helps you choose the best file format, verify that a logo uses only brand colours, check pixel art and sprites, confirm a scan is truly black and white, and understand why an image compresses well or badly. This free tool gives an exact answer in seconds, directly in your browser.
How to Count the Colours in an Image
- Upload an image. PNG gives exact results; JPG adds compression colours.
- Read the unique colour count and the number of pixels analysed.
- Check the notes for grayscale, transparency and format recommendations.
- Browse the most frequent colours, and click any swatch to copy its HEX code.
What the Colour Count Tells You
| Unique colours | Typical image | Best format |
|---|---|---|
| 2 | Black-and-white scans, line art, QR codes | PNG (1-bit) or GIF |
| 3–256 | Logos, icons, pixel art, simple charts | PNG-8 / GIF with no loss |
| 256–5,000 | Illustrations, UI screenshots | PNG, or a 256-colour PNG |
| 5,000+ | Photos, gradients, 3D renders | JPG or WebP |
Why Does My Simple Logo Have Thousands of Colours?
Two common reasons:
- Anti-aliasing: smooth edges are drawn with blended in-between shades, so a two-colour logo can have hundreds of edge colours.
- JPG compression: JPG introduces tiny colour variations everywhere. A logo saved as JPG can contain thousands of colours even though it looks flat.
To reduce colours deliberately, use the PNG Compressor, which maps an image to a palette of up to 256 colours.
Features
- Exact countingEvery pixel is checked at full resolution (up to 40 megapixels).
- FastA compact bitset counts even 20 MP photos in about a second.
- Top coloursThe 24 most frequent exact colours with pixel counts and percentages.
- Grayscale detectionConfirms whether every pixel is a neutral grey.
- Transparency reportCounts fully and partly transparent pixels separately.
- PrivateImages are analysed locally and never uploaded.
Practical Uses of Colour Counting
- Choosing a file format: images with 256 colours or fewer can be saved as indexed PNG or GIF with no loss and a much smaller file.
- Pixel art and game sprites: check that artwork stays within a limited palette, such as 16 or 32 colours.
- Brand compliance: make sure a logo or icon uses only approved colours, with no stray shades from careless exports.
- Print and embroidery: screen printing and embroidery are priced by the number of colours, so count them before ordering.
- Scanned documents: confirm a scan is truly black and white before archiving.
The most frequent colours list is especially helpful for spotting background colours, anti-aliasing shades and unwanted near-duplicates such as #FFFFFF and #FEFEFE, which look identical but count separately.
Tip: to compare two versions of a graphic, count both. A big jump in unique colours after an export usually means compression or resampling has introduced unwanted shades.
Frequently Asked Questions
Why do two colours that look the same count separately?
The counter compares exact RGB values. #FFFFFF and #FEFEFE are indistinguishable to the eye but are different colours in the file.
How can I reduce the number of colours?
Use the PNG Compressor to map the image to a palette of 256 colours or fewer, or the Image Pixelator to posterise it.
How many colours can an image have?
A standard 24-bit image can hold up to 16,777,216 colours, but an image can never have more unique colours than pixels. A 1000 × 1000 image has at most one million.
Are transparent pixels counted?
Fully transparent pixels are excluded from the RGB count because they have no visible colour. Semi-transparent pixels are counted by colour, and their distinct RGBA values are reported separately.
Why is the count different in another program?
Some programs count RGBA values, apply colour profiles or sample a reduced image. This tool counts exact RGB values as decoded by your browser.
What about very large images?
Images over 40 megapixels are sampled at 40 MP to stay within browser memory. The note under the count shows when this happens.
Is my image uploaded?
No. Counting happens entirely in your browser.