Simple image file formats.
PNM --- There are actually three PNM file formats: PBM for bilevel images, PGM for gray level images, and PPM for color images. These formats are widely used by popular image manipulation packages such as NetPBM http://www.arc.umn.edu/GVL/Software/netpbm.html or ImageMagick http://www.wizards.dupont.com/cristy/.RLE --- The binary RLE file format is a simple run-length encoding scheme for storing bilevel images. Encoding or decoding a RLE encoded file is extremely simple. Yet RLE encoded files are usually much smaller than the corresponding PBM encoded files. RLE files always begin with a header line composed of:
- the two characters "R4",
- one or more blank characters,
- the number of columns, encoded using characters "0" to "9",
- one or more blank characters,
- the number of lines, encoded using characters "0" to "9",
- exactly one blank character (usually a line-feed character).The rest of the file encodes a sequence of numbers representing the lengths of alternating runs of white and black pixels. Lines are encoded starting with the top line and progressing towards the bottom line. Each line starts with a white run. The decoder knows that a line is finished when the sum of the run lengths for that line is equal to the number of columns in the image. Numbers in range 0 to 191 are represented by a single byte in range 0x00 to 0xbf. Numbers in range 192 to 16383 are represented by a two byte sequence: the first byte, in range 0xc0 to 0xff, encodes the six most significant bits of the number, the second byte encodes the remaining eight bits of the number. This scheme allows for runs of length zero, which are useful when a line starts with a black pixel, and when a very long run (whose length exceeds 16383) must be split into smaller runs.
Alphabetic index Hierarchy of classes