Home  /  File formats  /  ppm

PPM file format

Extension.ppm
Categoryimages
Programs
Adobe Photoshop
Corel Draw
GIMP
Netpbm
DescriptionThe PPM format is a versatile way to store portable pixmap images. It's simple, yet effective in capturing color (PPM), grayscale (PGM), and black and white (PBM) images. It's a convenient tool for transferring bitmap image files of these three types across different platforms. The credit for creating the PPM format goes to Jeff Poskanzer.
Technical detailsA PPM file is made up of one or more PPM images lined up in sequence. There is no additional data, padding, or constraints before, during, or after the images. Each PPM image has a unique identifier known as a magic number, specifically "P6". This is followed by whitespace characters (spaces, TABs, CRs, and LFs) and the image width, expressed as ASCII characters in decimal form. Another ASCII decimal space follows this.
The color value, or Maxval, within a PPM image is given in decimal form. It should be more than zero but less than 65536. A single whitespace character on a separate line follows the Maxval. The image is then made up of a raster of height rows, arranged in reverse order. Each row comprises width pixels, laid out from left to right. The samples in a PPM image consist of binary information, represented by one or two bytes. If the Maxval is less than 256, the sample is one byte. If it's more, it's two bytes with the first byte being the most significant. There is also an alternate version of the PPM format known as the straightforward format, but it's not commonly used.
MIME type
image/x-ppm
image/x?portable?pixmap