Home » File types » Image files » PPM (Portable Pixmap File Format, .ppm)

PPM (Portable Pixmap File Format, .ppm)

The portable pixmap file format (PPM), the portable graymap file format (PGM) and the portable bitmap file format (PBM) specify rules for exchanging graphics files. They provide very basic functionality and serve as a least-common-denominator for converting pixmap, graymap, or bitmap files between different platforms. Several applications refer to them collectively as the PNM format (portable anymap).

Depending on the identification of the file format, portable pixmap systems can distinguish three similar file formats, each with two versions:

  • PBM - portable bitmap file format (P1/P4) - 1 bit per pixel
  • PGM - portable graymap file format (P2/P5) - 8 bits per pixel
  • PPM - portable pixmap file format (P3/P6) - 24 bits per pixel, 8 for red, 8 for green, 8 for blue

In each case, the lower-numbered version (P1, P2 or P3) refers to a human-readable, ASCII-based format similar to the one in the example above; and the higher-numbered version (P4, P5 or P6) refers to a binary format, not human-readable but more efficient at saving some space in the file, as well as easier to parse due to the lack of whitespace.