Basic Description
PCX files can hold the following Images: 4-color palletized CGA, 16-color palletized EGA, 256-color palletized VGA, and 24-bit truecolor.Derived Formats: SCR .
Business Software: | Home and Family: | ||
Load! - Container Optimization | Ages! - Family Tree Software |
Name | Size | Description | ||||
---|---|---|---|---|---|---|
Signature | 1 byte | =$0A ($CD for SCR) >$0A: This is a PCX font file ! (not described here) | ||||
Version | 1 byte | 0= Version 2.5 2= Version 2.8 with Palette 3= Version 2.8 without Palette 5= Version 3.0 | ||||
Compression | 1 byte | 1 = RLE compressed | ||||
BitsPerPixel | 1 byte | number of bits per pixel per plane | ||||
Xmin | 2 bytes | column of upper left corner of image. Most commonly = 0 | ||||
Ymin | 2 bytes | row of upper left corner of image. Most commonly = 0 | ||||
Xmax | 2 bytes | XSize = Xmax - Xmin + 1 | ||||
Ymax | 2 bytes | YSize = Ymax - Ymin + 1 | ||||
Xdpi | 2 bytes | used inconsistently across versions (info needed) | ||||
Ydpi | 2 bytes | used inconsistently across versions (info needed) | ||||
ColorTable | 48 bytes | Palette Information (one of the 3 following formats) | ||||
CGA / Monochrome | 48 bytes | see CGA Palette paragraph below | ||||
BackgroundColor | 1 byte | high-order 4 bits = Color (CGA hardware palette) | ||||
filler | 2 byte | unused | ||||
PaletteInfo | 1 byte | only 3 bits used | ||||
MonoFlag | bit 7 | 0 = Color 1 = Monochrome | ||||
Palette | bit 6 | 0 = Green, Red, Brown (Yellow) 1 = Cyan, Magenta, White | ||||
Intensity | bit 5 | 0 = dark 1 = light | ||||
reserved | bits 4-0 | unused filler 44 bytes unused =0 | ||||
16 color | 48 bytes | present, if NumColorPlanes = 1, and BitsPerPixel < 8 | ||||
Red | 1 byte | Red intensity | ||||
Green | 1 byte | Green intensity | ||||
Blue | 1 byte | Blue intensity | ||||
repeated 16 times | ||||||
256 color | 48 bytes | present if BitsPerPixel =8 | ||||
filler | 48 bytes | unused, but for 256 color images, the first 16color map entries of the image may be stored here in addition to the full palette at the end of this file. | ||||
reserved | 1 byte | =0 | ||||
NumColorplanes | 1 byte | 1 = Monochrome / Palletized 3 = RGB (valid ?) 4 = RGBI | ||||
BytesPerScanline | 2 bytes | size of uncompressed data per scan line. must be even. (can be any number for SCRs) | ||||
ColorTableType | 2 bytes | 1 = Color or B&W 2 = Grayscale | | ||||
filler | 58 bytes | makes the header a total of 128 bytes | ||||
Raster Data | cannot be pre calculated | The pixel data | ||||
Palette Header | 1 byte | =12, should be present if: Version = 2 or Version = 5, BitsPerPixel = 8, NumColorplanes = 1, ColorTableType = 1 | ||||
Palette | 768 bytes | present under same conditions as Palette Header |
CGA Palette 0, dark | Green | 0,128,0 | |
---|---|---|---|
Red | 128,0,0 | ||
Brown | 128,128,0 | ||
CGA Palette 0, light | light Green | 0,255,0 | |
light Red | 255,0,0 | ||
Yellow | 255,255,0 | ||
CGA Palette 1, dark | Cyan | 0,128,128 | |
Magenta | 128,0,128 | ||
Gray | 128,128,128 | ||
CGA Palette 1, light | light Cyan | 0,255,255 | |
light Magenta | 255,0,255 | ||
White | 255,255,255 |
Byte 1 (n) | Byte 2 (c) | Result | |
---|---|---|---|
>=$C0 | any | n consecutive pixels of color c | |
<$C0 | - | a pixel with color n. (c is already part of the next code) |