Count Unique Colors in PNG
Count the exact number of distinct colors in a PNG, with and without transparency, and see if it fits a palette. Runs entirely in your browser, so your data never leaves your device.
Runs on your device, nothing uploaded
Drop an image anywhere on this page
or paste with Ctrl / ⌘ + V ·
Accepts PNG
Your PNG files never leave this tab
Count Unique Colors in PNG is JavaScript that your browser has already downloaded, and it does the whole job on your own machine. On a normal site, 200 photos straight off a camera means 1.6 GB uploaded, a wait in somebody's queue, and 240 MB downloaded again. Here it means 0 bytes up and 0 bytes down.
- No upload
- No file size limit
- Works offline once loaded
- Nothing stored or logged
How to use Count Unique Colors in PNG
- 1. Add the PNG. Drop a PNG file. The pixels are read straight from the file in your browser, so semi-transparent colors are not blended or rounded before counting.
- 2. Read the count. The headline gives the number of distinct colors, where the same RGB at a different opacity counts separately and all fully transparent pixels count as one.
- 3. Check the details. Beside it you get the RGB-only count for visible pixels, the most common color and whether the picture fits an 8-bit palette of 256 colors.
When to use Count Unique Colors in PNG
Count Unique Colors in PNG gives the exact number of different colors a picture uses. It reads the stored pixel values directly instead of going through a canvas, which would round semi-transparent pixels and make the count drift. The palette check tells you whether the image can become an indexed PNG with no loss at all.
- Choosing between a palette and a truecolor PNG. 256 colors or fewer means an 8-bit palette PNG holds the picture exactly and is usually much smaller than a 32-bit file.
- Checking a pixel art or icon export. Pixel art should use a small fixed palette. A count far above it means the export added smoothing, scaling blur or a color profile shift.
- Spotting hidden anti-aliasing. A two-color logo that reports hundreds of colors has blended edge pixels; that is expected for smooth edges, but not for a crisp stencil or a print separation.
Examples
Flat icon
Input
icon.png
Output
This PNG uses 37 unique colors.
Photo
Input
photo.png
Output
This PNG uses 184,203 unique colors.
About the Count Unique Colors in PNG tool
Count Unique Colors in PNG is a free online tool that works entirely inside your web browser. Count the exact number of distinct colors in a PNG, with and without transparency, and see if it fits a palette. Because the processing happens on your own device, nothing you enter is uploaded, logged or stored anywhere.
This page is one of 292 PNG utilities on EditSafely. Each one does a single job well, and all of them follow the same rule: your input stays on your machine.
There is nothing to configure. Provide the input and the result appears on its own. 2 worked examples further down the page show exactly what the tool produces for real inputs.
Because nothing leaves your device, the tool is suitable for sensitive images such as ID scans, screenshots of internal systems or personal photos. It is also quick, since the pixels are processed on your own machine rather than by a remote API.
Frequently asked questions
Is Count Unique Colors in PNG free to use?
Yes, it is completely free. All 2,943 tools on EditSafely work without an account, a subscription or usage limits.
Are my files uploaded to a server?
Everything happens locally. Your browser downloads the tool's code once, then does all the processing itself; nothing you enter is transmitted, stored or logged. You can even go offline after the page loads and it will still work.
Which files does Count Unique Colors in PNG accept?
It accepts PNG images. There is no file size cap imposed by a server; very large files are limited only by your device's memory.
Do I need to sign up or install anything?
No. The tool works in any modern browser on desktop, tablet or phone. There is no account to create, no extension to add and no software to install.
How do I use the result?
Click Copy to put it on your clipboard, or Download .txt to save it as a file. Drop another image to start again.
Related tools
All PNG Tools →Analyze Pixel Color Distribution
Chart the red, green, blue and brightness levels of a PNG together and list its most frequent exact colors.
Reduce PNG Colors
Compress color variations to a restricted set of shades.
Find Dominant PNG Colors
Run a canvas audit to list the most common color hues present.
Compress a PNG File
Shrink a PNG by up to 80% with a smart color palette, or to an exact KB size.