100 likes | 661 Views
PPM file format. Name ppm - portable pixmap file format Definitions A "magic number" for identifying the file type. A ppm file's magic number is the two characters "P3" or “P6”. Whitespace (blanks, TABs, CRs, LFs). A width, formatted as ASCII characters in decimal.
E N D
PPM file format • Name • ppm - portable pixmap file format • Definitions • A "magic number" for identifying the file type. A ppm file's magic number is the two characters "P3" or “P6”. • Whitespace (blanks, TABs, CRs, LFs). • A width, formatted as ASCII characters in decimal. • A height, again in ASCII decimal. • The maximum color-component value, again in ASCII decimal. • Width * height pixels, each three ASCII decimal values between 0 and the specified maximum value, starting at the top-left corner of the pixel map, proceeding in normal English reading order. The three values for each pixel represent red, green, and blue, respectively. • Characters from a "#" to the next end-of-line are ignored (comments). • No line should be longer than 70 characters.
Sample Header P3 <-- Image format type # CREATOR: XV Version 3.10a Rev: 12/29/94 (PNG patch 1.2) <-- Comment 160 120 <-- 160 columns (width) and 120 rows (height) of image 255 <-- Max pixel value • 45 45 45 45 45 49 49 49 57 57 57 65 65 65 85 85 85 121 121 121 . . .