Encyclopedia > Portable Pixmap file format

  Article Content

Portable Pixmap file format

The portable pixmap file format (PPM) is a file format for exchanging color bitmap files. It is very basic and serves as a least common denominator for converting bitmap files between different platforms. It is used in the GNU netpbm file conversion package as the central file format for different conversion utilities.

Let's take the example of the letter J from the bitmap article

 ....X.
 ....X.
 ....X.
 ....X.
 ....X.
 ....X.
 X...X.
 .XXX..
 ......
 ......

It is represented in an similar, but even simpler file format version PBM (monochrome) as follows

 P1
 # This is an example bit map file j.pbm
 6 10
 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 0
 0 0 0 0 1 0
 1 0 0 0 1 0
 0 1 1 1 0 0
 0 0 0 0 0 0
 0 0 0 0 0 0

The P1 is the identificaton of the file format. The hash sign marks a commentary. And the next two numbers give the width and the height. Then follows the matrix with the pixel values (in the monochrome case here only zeros and ones).

 
This file can be converted by two conversion programs from the netpbm package for example to a bmp file:

 pgmtoppm #FFFFFF j.pbm  > j.ppm
 ppmtobmp j.ppm > j.bmp

Depending on the identification of the file format three similar file formats are distinguished:

  • pbm - portable bitmap file format (P1)
  • pgm - portable graymap file format (P2)
  • ppm - portable pixmap file format (P3)

The OpenOffice Draw program can import and export these file formats.

External link



All Wikipedia text is available under the terms of the GNU Free Documentation License

 
  Search Encyclopedia

Search over one million articles, find something about almost anything!
 
 
  
  Featured Article
East Marion, New York

... the town the population is spread out with 18.5% under the age of 18, 4.4% from 18 to 24, 20.6% from 25 to 44, 26.3% from 45 to 64, and 30.2% who are 65 years of age or ...

 
 
 
This page was created in 28.1 ms