The files are smaller and many times faster to read and write.Įxtended to support PPM (portable pixmap) format images (24 bits only). No whitespace is allowed in the grays section, and only a singleĬharacter of whitespace (typically a newline) is allowed after the maxval. The gray values are stored as plain bytes, instead of ASCII decimal. The "magic number" is "P5" instead of "P2". There is a PGM variant that stores the pixel data as raw bytes: No line should be longer than 70 characters. Characters from a "#" to the next end-of-line are ignored (comments). Means black, and the maximum value means white. Proceeding in normal English reading order. Tespace, starting at the top-left corner of the graymap, Width * height gray values, each in ASCII decimal, betweenĠ and the specified maximum value, separated by whi. The maximum gray value, again in ASCII decimal. A width, formatted as ASCII characters in decimal. A pgmįile's magic number is the two characters "P2". A "magic number" for identifying the file type.
The portable graymap format is a lowest common denominator