Xref: utzoo comp.graphics:3837 comp.sys.ibm.pc:21923 Path: utzoo!utgpu!watmath!watdcsu!broehl From: broehl@watdcsu.waterloo.edu (Bernie Roehl) Newsgroups: comp.graphics,comp.sys.ibm.pc Subject: Re: PCX file format Keywords: bitmaps Message-ID: <5355@watdcsu.waterloo.edu> Date: 7 Dec 88 16:01:38 GMT References: <1972@van-bc.UUCP> Reply-To: broehl@watdcsu.waterloo.edu (Bernie Roehl) Organization: U. of Waterloo, Ontario Lines: 70 In article <1972@van-bc.UUCP> sl@van-bc.UUCP (pri=-10 Stuart Lynne) writes: >Does anyone out there have details on PCX file formats (PC Paintbrush). Yes (see below) >Appreciate any pointers. You can contact ZSoft at (404)428-0008; I believe their tech support is ext 371. They are very helpful. They will also send you (free of charge) a ZSoft Technical Reference Manual (booklet, actually) that describes the pcx file format, the bitmap font file format and information on the application programmer's interface to Frieze. To save you time, here is the pcx format: 128 byte header: byte constant 10 decimal indicates PC Paintbrush PCX byte version (see below) byte encoding scheme (1 == PCX run-length encoding, see below) byte bits per pixel word xmin word ymin word xmax word ymax word horizontal resolution word vertical resolution 48 bytes of colormap (see below) byte reserved byte number of planes word bytes per line remainder is zero filled the version number is one of: 0 version 2.5 2 version 2.8 with pallete info 3 version 2.8 without pallete info 5 version 3.0 with pallete info the colormap is sixteen 3-byte entries. For EGA, AT&T DEB, etc these 3 bytes represent the intensities of Red, Green and Blue for that color (colors go from 0 to 15). The 256 possible intensities are not available on all hardware, so the range is divided up. (details in the manual) On CGA type displays, only the first byte of each triple is used. The top nibble of the first byte of the first triple is the background color. The top nibble of the first byte of the second triple is the foreground color. The run-length encoding is straightforward. If a byte has the top two bits set (i.e. byte & 0xC0 == 0xC0) then the bottom six bits (byte & 0x3F) give a count and the following byte is a value that is to be repeated that number of times. Otherwise the byte is the data and the count is 1. For multiplane displays, the four sets of values for a given scan line follow each other consecutively in the order Blue, Green, Red, Intensity, followed by the four sets for the second line, and so on. If you need more information than this, call ZSoft and order the manual; I'm swamped with work right now and can't handle specific requests (sorry). Hope the above is useful to you. -- Bernie Roehl, University of Waterloo Electrical Engineering Dept Mail: broehl@watdcsu.UWaterloo{.edu,.csnet,.cdn} BangPath: {allegra,decvax,utzoo,clyde}!watmath!watdcsu!broehl Voice: (519) 745-4419 [home] (519) 885-1211 x 2607 [work]