File Format Description
Each format differs in what colors it is designed to represent:
- PBM is for bitmaps (black and white, no grays)
- PGM is for grayscale
- PPM is for "pixmaps" which represent full RGB color.
Each file starts with a two-byte magic number (in ASCII) that explains the type of file it is (PBM, PGM, and PPM) and its encoding (ASCII or binary). The magic number is a capital P followed by a single digit number.
Magic Number | Type | Encoding |
---|---|---|
P1 |
Portable bitmap | ASCII |
P2 |
Portable graymap | ASCII |
P3 |
Portable pixmap | ASCII |
P4 |
Portable bitmap | Binary |
P5 |
Portable graymap | Binary |
P6 |
Portable pixmap | Binary |
The ASCII based formats allow for human-readability and easy transport to other platforms (so long as those platforms understand ASCII), while the binary formats are more efficient both at saving space in the file, as well as being easier to parse due to the absence of whitespace.
When using the binary formats, PBM uses 1 bit per pixel, PGM uses 8 bits per pixel, and PPM uses 24 bits per pixel: 8 for red, 8 for green, 8 for blue.
Read more about this topic: Netpbm Format
Famous quotes containing the words file and/or description:
“While waiting to get married, several forms of employment were acceptable. Teaching kindergarten was for those girls who stayed in school four years. The rest were secretaries, typists, file clerks, or receptionists in insurance firms or banks, preferably those owned or run by the family, but respectable enough if the boss was an upstanding Christian member of the community.”
—Barbara Howar (b. 1934)
“Why does philosophy use concepts and why does faith use symbols if both try to express the same ultimate? The answer, of course, is that the relation to the ultimate is not the same in each case. The philosophical relation is in principle a detached description of the basic structure in which the ultimate manifests itself. The relation of faith is in principle an involved expression of concern about the meaning of the ultimate for the faithful.”
—Paul Tillich (18861965)