A PCX image’s colours come from one of two palettes, or from its planes directly. 24-bit images have three planes of red, green and blue and need no palette.
The header palette
The 48 bytes at offset 16 hold 16 colours of three bytes each, red, green and blue. An image with 16 or fewer colours uses them directly. In an image with fewer colours, only the first entries are used.
On EGA displays, ZSoft maps the value of each channel to four levels: 0–63 is level 0, 64–127 level 1, 128–192 level 2 and 193–254 level 3.
Version 3 says the palette bytes are not to be used. Files with no palette in the header have nothing to go on, so the explorer falls back to the standard colours in that case.
CGA images
With 2 bits and one plane the header palette holds CGA settings instead. Byte 16 is the background colour in its top four bits (0 to 15), and byte 19 gives the foreground palette in its top three bits:
| Bit of byte 19 | Name | Meaning |
|---|---|---|
| 7 | colour burst | 0 colour, 1 monochrome |
| 6 | palette | 0 yellow, 1 white |
| 5 | intensity | 0 dim, 1 bright |
PC Paintbrush IV and later do not support this. The explorer shows these images with the four colours in the header when the header holds any, and with the standard CGA colours otherwise.
The 256-colour palette
A version 5 image with 8 bits and one plane can have a palette at the very end of the
file, after the image data: the byte 0C, then 768 bytes of 256 RGB
colours. To find it, look at the byte 769 from the end of the file. If it is
0C, the palette follows.
0Header128 bytes128Image datavariessize − 769Marker0C1 bytesize − 768Palette 256 colours, red, green, blue768 bytes
ZSoft notes that the values are stored 0 to 255, and that VGA hardware expects 0 to 63, so programs divide them by 4 for the screen. An 8-bit file with no palette is usually a greyscale image.