What is color depth?

Color depth, or bit depth, is the number of bits used to store each pixel's color, which sets how many distinct colors an image can represent.

By · Updated

Want the full walkthrough? Read: Why is my PNG file so large? →

Explained in more detail

Color depth is measured either per pixel or per channel, and it is worth checking which one a number refers to. Each added bit doubles the number of values.

Per pixel: 8 bits gives 256 colors, as in an indexed PNG-8 or GIF. 24 bits, which is 8 bits for each of red, green and blue, gives 2^24 = 16,777,216 colors. This is often called "true color" and is common for photos and screens. Add an 8-bit alpha channel and the total is 32 bits per pixel.

Per channel: 8 bits means 256 levels each of red, green and blue. 16 bits per channel, supported by PNG and by editing formats, gives 65,536 levels. High-bit-depth images matter for editing and for smooth gradients and HDR, because they give more headroom before banding appears. AVIF can carry 10 or 12 bits per channel.

Higher depth means more data per pixel, so larger files. That is why reducing color depth is a valid way to shrink an image. A logo with six flat colors does not need 16 million possible colors; storing it as an indexed 8-bit PNG can be far smaller with no visible change. Reducing depth on a photograph or gradient causes visible banding, where smooth transitions turn into stripes.

Most web images are 8 bits per channel. On a typical 8-bit display, a 16-bit PNG often adds file size without a visible improvement.

Related terms

Try it in Triim

Further reading

Sources

Part of the Triim image terms glossary, by Rocco Bombardieri.