[aus.computers.ibm-pc] Inner details of PCX file format

johnmac@fawlty.towers.oz (John MacLean) (09/25/90)

I have written software that interprets PCX files (after seeking
documentation) but am having some problems.

I have no problems decoding the image data from the docs I have, but I
cannot get the palette / RGB values for each pixel correct, only
a 0..2^n - 1 value for each pixel (where n = number of bits per pixel).

How do I get from this index to an RGB value?
The docs describe a $30 byte palette of $10 RGB tripples - is this
used?
The files I have are 1 bit per pixel and 8 bits per pixel - but if
others are common I would like to know how to get RGB values from
these as well.

The 8 bits per pixel files have $0300 bytes additional at the end of the
file which my docs do not describe (This is the exact length of $100 RGB
tripples - but it does not appear to contain such data).

Thanks, John MacLean.

-- 
This net: johnmac@fawlty.towers.oz.au                   Phone: +61 2 427 2999
That net: uunet!fawlty.towers.oz.au!johnmac             Fax:   +61 2 427 7072
Snail:    Tower Technology, Unit D 31-33 Sirius Rd,     Home:  +61 2 960 1453
          Lane Cove, NSW 2066, Australia.