Portable PixMap
The portable pixmap file format ( PPM ), the portable graymap file format ( PGM ) and the portable bitmap file format ( PBM ) are formats of graphic file used for the exchanges. They propose very basic functionalities and are used to convert the files of the type Pixmap, Graymap and Bitmap between various platforms. Several applications indicate this whole of three format like the format PNM ( portable anymap ).
PBM
This format of file is used for images black and white. There exist two alternatives: binary or rough.
Binary file
A binary file pbm is composed as follows:
-
a magic number (P4)
- a character of spacing (space, tabulation, new line)
- Width of the image (coded in characters ASCII)
- a character of spacing
- Height of the image (coded in ASCII characters)
- a character of spacing
- Given binary of the image:
All the lines starting with # are ignored.
Rough file
A file pbm gross is composed as follows:
-
a magic number (P1)
- a character of spacing (space, tabulation, new line)
- Width of the image (coded in characters ASCII)
- a character of spacing
- Height of the image (coded in ASCII characters)
- a character of spacing
- Given ASCII of the image:
- the image is coded line by line on the basis of the top
- Each line is coded from left to right
- a black pixel is coded by a character 1, a white pixel is coded by a character 0
- the characters of spacing inside this section are ignored
- No line should not exceed 70 characters.
All the lines starting with # are ignored.
PGM
This format of file is used for images in level of gray. There exist two alternatives: binary or rough.
Binary file
A binary file pgm is composed as follows:
-
a magic number (P5)
- a character of spacing (space, tabulation, new line)
- Width of the image (coded in characters ASCII)
- a character of spacing
- Height of the image (coded in ASCII characters)
- a character of spacing
- the maximum value used to code the levels of gray, this value must be lower than 65536 (coded in ASCII characters)
- a character of spacing
- Données binary of the image:
- the image is coded line by line on the basis of the top
- Each line is coded from left to right
- Each pixel is coded by 1 or 2 bytes according to whether the maximum value is lower or higher than 256. A black pixel is coded by value 0, a white pixel is coded by the maximum value and each level of gray is coded by a value between these two extremes, proportionally with its intensity.
All the lines starting with # are ignored.
Rough file
A file pgm gross is composed as follows:
-
a magic number (P2)
- a character of spacing (space, tabulation, new line)
- Width of the image (coded in characters ASCII)
- a character of spacing
- Height of the image (coded in ASCII characters)
- a character of spacing
- the maximum value used to code the levels of gray, this value must be lower than 65536 (coded in ASCII characters)
- a character of spacing
- Données ASCII of the image:
- the image is coded line by line on the basis of the top
- Each line is coded from left to right
- Each pixel is coded by a value in ASCII characters, is preceded and followed by a character by spacing. A black pixel is coded by value 0, a white pixel is coded by the maximum value and each level of gray is coded by a value between these two extremes, proportionally with its intensity.
- No line must exceed 70 characters.
All the lines starting with # are ignored.
See too
-
page of handbook of pbm or http://man.developpez.com/man5/pbm.5.php
| Random links: | Theorem of Kennelly | Vannevar Bush | Logan mount | Pont de la Tortière | Herpesviridae | Najee | Michelle_Stephenson |