Portable Pixmap

Portable Pixmap

(file format)(PPM) A colour image file format.

A PPM file contains the following:

a two character "magic number" - "P3",the width in pixels,the height in pixels,the maximum colour component value,HEIGHT rows of WIDTH pixels.

The rows are ordered from top to bottom with the pixels ineach row ordered from left to right. Each pixel isrepresented as three values for red, green, and blue.

All parts are separated by whitespace and numbers are indecimal ASCIII representation. A zero pixel component meansthat colour is absent. Characters from a "#" to the nextend-of-line are ignored and no line should be longer than 70characters.

Here is an example of a small pixmap in this format:

P3# feep.ppm4 4150 0 0 0 0 0 0 0 0 15 0 150 0 0 0 15 7 0 0 0 0 0 00 0 0 0 0 0 0 15 7 0 0 015 0 15 0 0 0 0 0 0 0 0 0

A "RAWBITS" variant has magic number "P6", pixel values arestored as plain binary bytes, instead of ASCII decimal and nowhitespace is allowed after a single whitespace characterafter the maximum colour component value which must be lessthan or equal to 255.