Confused by PNG bit depth when you save an image? It is the number of bits stored for each sample, and the color type you choose decides which depths are allowed.
If you want the wider picture first, our guide to the png file format covers the basics this page builds on.
| Item | Value |
|---|---|
| Sample depth range | 1 to 16 bits |
| Valid bit depth values | 1, 2, 4, 8 and 16 bits |
| Valid color type codes | 0, 2, 3, 4 and 6 |
| Largest truecolor pixel | Up to 48 bits per pixel |
| Indexed image palette limit | Up to 256 colors |
| Bit depth field size in the header | 1 byte |
These figures come from the PNG specification and its chunk specifications. Standards documents get revised, so check the source before you rely on them.
What PNG bit depth measures
The bit depth field is a number in the file header that tells a decoder how many bits make up one sample. The chunk specifications define it per sample or per palette index, and state plainly that it is not per pixel.
A sample is one channel of a pixel: a gray level, a red, green or blue value, or an alpha value. A pixel’s total size therefore depends on how many samples its color type gives it.
That explains the headline limits. Sample depths run from 1 to 16 bits, grayscale images reach up to 16 bits per pixel, and truecolor images reach up to 48 bits per pixel, according to the PNG specification.
Five bit depth values are valid: 1, 2, 4, 8 and 16 bits. Not every value works with every color type, as the chunk specifications point out and the sections below spell out.
The five PNG color types
Color type is a single-byte code that describes how to read the image data. The codes are built from three flags: 1 means a palette is used, 2 means color is used, and 4 means an alpha channel is used, per the chunk specifications.
Combining those flags leaves only five valid codes: 0, 2, 3, 4 and 6. Code 3 is a palette plus color, code 6 is color plus alpha, and code 4 is a grayscale image with alpha.
Types 4 and 6 add a full alpha channel, which the PNG specification describes as general transparency masks. Types 0 and 4 are grayscale, so the chunk specifications forbid a palette in them.

Which bit depths each color type allows
Bit depth and color type are chosen as a pair. This table lists the combinations the specification permits.
| Color type | Each pixel is | Allowed bit depths |
|---|---|---|
| 0 | A grayscale sample | 1, 2, 4, 8 or 16 bits |
| 2 | An R,G,B triple | 8 or 16 bits |
| 3 | A palette index | 1, 2, 4 or 8 bits |
| 4 | A grayscale sample followed by an alpha sample | 8 or 16 bits |
| 6 | An R,G,B triple followed by an alpha sample | 8 or 16 bits |
The table follows the allowed-combinations list in the chunk specifications. The specification can be revised, so check the source before you rely on it.
Two patterns stand out. Depths of 1, 2 and 4 bits appear only for grayscale and indexed images, while truecolor and the alpha types accept only 8 or 16 bits.
The same chunk chapter says these limits exist to simplify implementations and to prohibit combinations that do not compress well. It also says decoders must support every valid combination, so a conforming file in any listed pairing should open.
How the palette works in indexed PNGs
Indexed color stores a short list of colors once and lets each pixel point to one of them. The PLTE chunk holds that list, and an indexed image can use up to 256 colors, according to the PNG specification.
These rules from the chunk specifications shape how a palette behaves:
- Pixel value 0 points to the first palette entry, pixel value 1 to the second, and so on.
- The palette must not hold more entries than the bit depth can address, though fewer are allowed.
- A pixel value beyond the entries actually present counts as an error.
- The palette chunk is required for color type 3, optional for types 2 and 6, and forbidden for types 0 and 4.
- Palette colors always use 8 bits per sample, whatever the pixel depth is.
In a truecolor file the palette is only a hint for viewers that cannot show truecolor directly. It stays 8 bits deep even when it summarizes an image with 16 bits per sample, as the chunk specifications note.
How do you choose a color type and depth?
Work from what the image needs, not from the biggest number on the menu. This checklist maps common needs onto the rules above, which come from the chunk specifications.
- If you need smooth transparency, pick color type 4 or 6, because both add an alpha sample (alpha rules).
- If you need full color, pick type 2 or 6 at 8 or 16 bits per sample (truecolor rules).
- If the image is a flat graphic with a limited set of colors, pick indexed color, which holds up to 256 colors (palette limit).
- If the image is only shades of gray, pick type 0, or type 4 when you also need alpha (grayscale rules).
Your editor may label these options differently, so match its wording to the codes and depths in the table above. If you are weighing animation as well, our explainer on what is apng covers that side of the format.
Where the header stores these values
Both settings live in the IHDR chunk, which must appear first in the file. Bit depth takes 1 byte and color type takes 1 byte, according to the chunk specifications.
A valid PNG image must also contain one or more IDAT chunks and an IEND chunk. For the full chunk layout around the header, our guide to png file structure walks through each piece.
The raw pixel data is built from scanlines whose layout and total size are determined by the IHDR fields, as the chunk specifications explain. The header values therefore steer how every pixel is read back.
Frequently asked questions
Is bit depth the same as bits per pixel?
Show answer
No. The field describes a single channel value or a single palette index. Multiply it by the channel count your color type defines to get the size of a pixel.
What is the highest bit depth PNG supports?
Show answer
Sixteen bits per sample is the ceiling. Color types 0, 2, 4 and 6 can reach it, while indexed color stops at a depth of 8 bits, as the chunk specifications list.
Can a truecolor PNG use a shallow depth?
Show answer
Not under the allowed-combinations list, where color type 2 accepts only 8 or 16 bits. Shallower depths belong to grayscale and indexed images, per the chunk specifications.
Does an indexed PNG store its palette at the same depth as its pixels?
Show answer
No. The color values in the palette stay at a fixed 8 bits per channel, whether the pixel indexes are shallow or not, according to the chunk specifications.



