Pilot The PCCV Project: Information
Techniques (CVonline) Other stuff |
Why PEIPA uses PBMPLUS-format imagesThere are dozens, if not hundreds, of different image file formats in use today. As it is not feasible to store data in more than one format on PEIPA itself, it makes sense to choose a format that can easily be converted to others. Many image formats (e.g., JPEG) involve lossy compression and so are inherently unsuited for dissemination; others (e.g., GIF) involve technologies that are the subject of patent restrictions. Hence, the choice was made some years ago to store the imagery on PEIPA in the formats provided by the PBMPLUS (and, latterly, NETPBM) packages. These packages are widely available:
NETPBM (which contains the more up-to-date software) and PBMPLUS both allow images to be converted many other formats, including TIFF, BMP, FITS and PostScript. They also allow many other image formats to be converted into their native formats. If you want to read PBMPLUS-format images directly into your programs, you have two options
The PBMPLUS formatsThe PBMPLUS package was written by Jef Poskanzer, is freely-distributable, and is widely used in image processing circles. It started life as a simple exchange mechanism for bit-maps (representations of bi-level raster data). It has subsequently been extended to handle grey-scale and colour images. The following notation is used:
The actual file formats are described below, adapted from the PBMPLUS manual pages. Portable Bitmap File FormatThe portable bitmap format is a lowest common denominator monochrome file format. It was originally designed to make it reasonable to mail bitmaps between different types of machines using the typical stupid network mailers we have today. Now it serves as the common language of a large family of bitmap conversion filters. The definition is as follows:
A small bitmap in this format is shown below. Programs that read this format should be as lenient as possible, accepting anything that looks remotely like a bitmap. P1 # feep.pbm 24 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 1 1 1 0 0 0 1 1 1 0 0 0 1 1 1 0 0 0 1 1 1 1 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 There is also a variant on the format, available in the programs that comprise the PBMPLUS package, by setting the RAWBITS option at compile time. This variant is different in the following ways:
Portable Graymap File FormatThe portable graymap format is a lowest common denominator grayscale file format. The definition is as follows:
An example of a small graymap in this format is shown below. Programs that read this format should be as lenient as possible, accepting anything that looks remotely like a graymap. P2 # feep.pgm 24 7 15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 3 3 3 0 0 7 7 7 7 0 0 11 11 11 11 0 0 15 15 15 15 0 0 3 0 0 0 0 0 7 0 0 0 0 0 11 0 0 0 0 0 15 0 0 15 0 0 3 3 3 0 0 0 7 7 7 0 0 0 11 11 11 0 0 0 15 15 15 15 0 0 3 0 0 0 0 0 7 0 0 0 0 0 11 0 0 0 0 0 15 0 0 0 0 0 3 0 0 0 0 0 7 7 7 7 0 0 11 11 11 11 0 0 15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 There is also a variant on the format, available in the programs that comprise the PBMPLUS package, by setting the RAWBITS option at compile time. This variant is different in the following ways:
Note that this raw format can only be used for maxvals less than or equal to 255. If you use the PGM library and try to write a file with a larger maxval, it will automatically fall back on the slower but more general plain format. Portable Pixmap File FormatThe portable pixmap format is a lowest common denominator colour image file format. The definition is as follows:
An example of a small pixmap in this format is shown below. Programs that read this format should be as lenient as possible, accepting anything that looks remotely like a pixmap. P3 # feep.ppm 4 4 15 0 0 0 0 0 0 0 0 0 15 0 15 0 0 0 0 15 7 0 0 0 0 0 0 0 0 0 0 0 0 0 15 7 0 0 0 15 0 15 0 0 0 0 0 0 0 0 0 There is also a variant on the format, available in the programs that comprise the PBMPLUS package, by setting the RAWBITS option at compile time. This variant is different in the following ways:
Note that this raw format can only be used for maxvals less than or equal to 255. If you use the PPM library and try to write a file with a larger maxval, it will automatically fall back on the slower but more general plain format. Portable Anymap File FormatThe PNM programs operate on portable bitmaps, graymaps, and pixmaps, produced by the PBM, PGM, and PPM segments. There is no file format associated with PNM itself. |
Last updated 2012-06-21 11:13:08 by Adrian F. Clark. [Accessibility information.]