pngtoolskit.org
PNG and image utilities, in the browser
Workflows Sign in Create accountSign up

Count the Colors in a PNG

unique colours (counting alpha) · batch · nothing uploaded

Find out how many distinct colours a PNG actually uses. Drop the file and the tool scans every pixel and reports the count of unique RGBA values — computed in your browser, nothing uploaded. A quick way to see whether an image is a candidate for palette (indexed) compression.

Drop images here

Multiple files allowed · one report per image

    no files
    Ready.

    Why the colour count matters

    An image with 256 or fewer colours can be stored as an indexed (palette) PNG, which is often dramatically smaller than a full-colour one — icons, logos, and flat illustrations frequently qualify. Photographs, by contrast, usually have tens or hundreds of thousands of unique colours. Counting first tells you which category you're in.

    How it counts

    Every pixel's exact red, green, blue and alpha values are treated as one colour, so two pixels that look identical but differ by a single alpha step count separately. That's the honest definition — anti-aliased edges alone can push a "simple" logo into the thousands.

    FAQ

    How do I know how many colors an image has?

    Drop it above and click Count colors — the number of unique RGBA colours is reported, scanned pixel-by-pixel in your browser.

    My simple logo has thousands of colors — why?

    Almost always anti-aliasing: the smooth edges blend the shape colour into the background across many intermediate shades. Flatten or re-export without anti-aliasing to shrink the palette.

    To see which colours, not just how many?

    Use the Color picker to sample specific pixels, or Inspector for a broader read.

    Part of: Work out what is wrong with a PNG

    Start with the validator. It tells you whether the file is broken or merely unexpected, which are different problems.

    1. 1 PNG validator Signature, chunk order and CRCs, checked
    2. 2 Chunk viewer Every chunk in the file and what it holds
    3. 3 Inspector Dimensions, bit depth, colour type, metadata
    4. 4 Color count Whether it is really as complex as it looks
    5. 5 Dimensions What the pixels actually measure

    All 28 step-by-step workflows