Image Color Counter
Count how many unique colours an image contains, see the most common ones with percentages, and check whether it fits a 256-colour PNG-8 or GIF palette.
What is the Image Color Counter?
How many colours does this image actually use? ByteTools answers it exactly: every opaque pixel is packed into a 24-bit key and tallied in a typed-array bitmap, so the unique total is a real count rather than an estimate — and it runs over the image at full resolution, not on a sample.
- Exact unique colour count over every pixel at full resolution
- Grouping to 6, 5 or 4 bits per channel for noisy photographs
- Top 24 colours as swatches with counts and percentages
- Instant verdict on 256-colour PNG-8 and GIF palette fit
- Option to skip fully transparent pixels
- Copyable tab-separated list, all computed in your browser
How to use the Image Color Counter
- 1
Drop an image into the upload area to scan it.
- 2
Leave the precision on exact for a true 24-bit count, or group to 6, 5 or 4 bits to merge near-identical shades.
- 3
Untick the transparent-pixel option if you want clear pixels counted as a colour too.
- 4
Read the palette verdict to see whether the image fits a 256-colour PNG-8 or GIF.
- 5
Copy the top colours list with their counts and percentages.
About the Image Color Counter
How many colours does this image actually use? ByteTools answers it exactly: every opaque pixel is packed into a 24-bit key and tallied in a typed-array bitmap, so the unique total is a real count rather than an estimate — and it runs over the image at full resolution, not on a sample.
The result tells you straight away whether the file would survive a 256-colour PNG-8 or GIF palette without quantization, which is the practical question behind most colour counts. You also get the twenty-four most common colours with their exact percentages, ready to copy as a tab-separated list, and the option to skip fully transparent pixels.
A precision selector groups near-identical shades to 6, 5 or 4 bits per channel when the exact count is dominated by JPEG noise — a photo can report millions of unique values that are visually a single colour. All the counting happens in your browser on canvas pixel data: 100% local, nothing uploaded to a server.
Frequently asked questions
How many colours can an image have?
A standard 8-bit-per-channel image can contain up to 16,777,216 distinct RGB values, though it can never have more unique colours than it has pixels. A one-megapixel photo therefore tops out at a million, and a flat logo may use only a handful.
Why does my simple-looking photo report thousands of colours?
JPEG compression and sensor noise nudge neighbouring pixels by a value or two, so an area that looks like one flat tone is really thousands of near-identical shades. Switch the precision selector to 5 or 6 bits per channel to merge them and get a count that matches what you see.
How do I know if my image will fit in a GIF or PNG-8?
Both formats use a palette of at most 256 colours. If the exact unique count comes in at or below 256 the tool confirms the image converts with no loss at all; above that, saving as GIF or PNG-8 requires quantization, which shows up as banding in gradients.
Does the tool count transparent pixels as a colour?
By default fully transparent pixels are skipped, since their RGB values are usually meaningless. Untick that option and they are included using whatever colour data sits behind the transparency, which occasionally matters when debugging an export.
Is my image uploaded to count its colours?
No. Pixels are read into a canvas and tallied in your browser's memory, and nothing is transmitted to a server. Very large images are handled locally too, so the only real limit is the memory available to your browser tab.
Guides for Image Color Counter
Related tools
Average Color of an Image
Find the average colour of any image as HEX, RGB and HSL, with a gamma-correct mean, a per-channel median and a grid of per-region averages.
Color Picker from Image
Pick colors from any image online. Click a photo to get exact HEX, RGB and HSL values with copy buttons and a history of recent picks — free and private.
Color Palette Generator
Generate complementary, analogous, triadic, tetradic and monochromatic color palettes from any base color. Click any swatch to copy its HEX code fast.
Image Metadata Viewer
View image metadata and EXIF data online: camera make, model, date taken, ISO, exposure, GPS location, dimensions and file size — all private.
Image Compressor
Compress JPG, PNG and WebP images in your browser with an adjustable quality slider. See before/after file size and download the smaller image free.