CyberArmy University | Open Source Institute | CyberArmy Intelligence & Security | CyberArmy Services & Projects

[Graphics] PCX File Format


[Reply] [View by Thread] [Help]
[Back To Article Discussion Forum]

Posted by Author Rae On 2007-04-29 10:02:26




View and vote on the article here: PCX File Format


PCX File Format

Category
Graphics
Summary
Body
PCX File Format


This article gives an overview of the PCX graphic file format. While it is true that this format is not much in use now a days, none the less it is important from a conceptual viewpoint, since it gives a good understanding of what a graphic file format should be like.

PCX is a bitmap format. It was originally used by the PC bitmap editing software Paintbrush by Z-Soft Corporation. In its early days the format only supported 4 or 16 colors. But later versions support 256 colors and have the ability to store 24 bit color images. The file structure of the PCX format consists of three parts:
  • File Header
  • Image data
  • Color palette
The file header is of 128 bytes. It contains important information about the characteristics of the image, pixel information and may also contain the color palette. The first byte, that is, byte 0, contains information about the manufacturer, which in the case of PCX files is Z-Soft. It has a fixed value of 10. Byte 1 contains version information. Its value is generally set to 5 to indicate version 3.0. Byte 2 indicates whether the file uses Run Length Encoding (RLE). Byte 3 contains information about bits per pixel. Its value is generally set to 8, to indicate use of 256 colors.

Bytes 4-11 are used to indicate picture dimensions. Bytes 12-13 are used to indicate horizontal resolution while bytes 14-15 are used to indicate vertical resolution. Bytes 16-63 are used to provide information about color palette settings. Byte 64 is reserved. Byte 65 is used to indicate the number of color planes. Bytes 66-67 tell about the number of bytes per scan line per color plane. Bytes 68-69 are used to give information about how to interpret the color palette. The rest of the bytes serve as filler and are left blank.

The PCX file may either use color palettes or color planes to record pixel data. When the image uses color planes, it does not require a color table. The image data itself will store pixel color information about the primary colors, red, green and blue. For instance, if a file uses 24 bits for each pixel, it means that 8 bits will be used to indicate red, 8 for green and 8 for blue. This will complete the information required to display one pixel.

If, instead of color planes, color palettes are used, RGB palettes are stored in the color table. The image data then starts acting as a pointer to the color table to get the required information used to display a pixel.


References :

Computer Graphics by Foley, VanDam, Fiener, Hughes

Multimedia Systems by Ralf Steinmetz and Klara Nahrstedt

Written by: rae (June 9th, 2005)

rae is C/O of OPERATION COMMLINX


This article was imported from the CyberArmy University site. (original author: rae)


There are no replies to this post yet.



Guest:
Subject:
Message:
Signature:
Optional Image Link:
http://

CyberArmy::Forum v0.6
Generated In 0.05244 seconds


About Us | Privacy Policy | Mission Statement | Help