PNM file format
Extension | .pnm |
Category | images |
Description | The PNM (Portable Any Map) format is a group of image file formats used for portable images, which are maps of pixel values that can represent grayscale or color data. The PNM format family consists of three types of file formats: PBM (Portable BitMap), PGM (Portable GrayMap), and PPM (Portable PixMap). |
Technical details | In PBM format, pixel values are binary, with each pixel represented by a single bit. A value of 0 represents black, and a value of 1 represents white. Each row of pixel data is stored as a sequence of bits, padded to the nearest byte. In PGM format, pixel values are grayscale, with each pixel represented by a single byte. The pixel data is stored as a sequence of bytes, with each row of pixel data stored contiguously. In PPM format, pixel values are in color, with each pixel represented by three bytes representing the red, green, and blue components. The pixel data is stored as a sequence of triples of bytes, with each row of pixel data stored contiguously. PNM files can be easily converted between the three formats, as well as to and from other image file formats using various software tools. |