Seth Woolley's Man Viewer

ppm(5) - ppm - portable pixmap file format - man 5 ppm

([section] manual, -k keyword, -K [section] search, -f whatis)
man plain no title

ppm(5)                                                                  ppm(5)



NAME
       ppm - portable pixmap file(1,n) format

DESCRIPTION
       The  portable  pixmap format is a lowest common denominator color image
       file(1,n) format.  The definition is as follows:

       - A "magic(4,5) number" for identifying the file(1,n) type.  A ppm  file(1,n)'s  magic(4,5)
         number is the two characters "P3".

       - Whitespace (blanks, TABs, CRs, LFs).

       - A width, formatted as ASCII characters in(1,8) decimal.

       - Whitespace.

       - A height, again in(1,8) ASCII decimal.

       - Whitespace.

       - The maximum color-component value, again in(1,8) ASCII decimal.

       - Whitespace.

       - Width  * height pixels, each three ASCII decimal values between 0 and
         the specified maximum value, starting at the top-left corner  of  the
         pixmap,  proceding in(1,8) normal English reading order.  The three values
         for each pixel represent red, green, and blue, respectively; a  value
         of  0 means that color is off, and the maximum value means that color
         is maxxed out.

       - Characters from a "#" to the next end-of-line are ignored (comments).

       - No line should be longer than 70 characters.

       Here is an example of a small pixmap in(1,8) this format:

       P3
       # feep.ppm
       4 4
       15
        0  0  0    0  0  0    0  0  0   15  0 15
        0  0  0    0 15  7    0  0  0    0  0  0
        0  0  0    0  0  0    0 15  7    0  0  0
       15  0 15    0  0  0    0  0  0    0  0  0

       Programs  that  read(2,n,1 builtins)  this  format  should  be  as lenient as possible,
       accepting anything that looks remotely like a pixmap.

       There is also a variant on the format, available by setting the RAWBITS
       option  at  compile  time.   This variant is different in(1,8) the following
       ways:

       - The "magic(4,5) number" is "P6" instead of "P3".

       - The pixel values are stored as plain bytes, instead of ASCII decimal.

       - Whitespace is not allowed in(1,8) the pixels area.

       - The files are smaller and many times faster to read(2,n,1 builtins) and write.

       Note  that  this  raw(3x,7,8,3x cbreak)  format can only be used for maxvals less(1,3) than or
       equal to 255.  If you use the PPM library and try to write(1,2) a file(1,n)  with
       a larger maxval, it will automatically fall back on the slower but more
       general ASCII format.

SEE ALSO
       giftoppm(1), ilbmtoppm(1), imgtoppm(1), mtvtoppm(1), qrttoppm(1), rast-
       toppm(1),  tgatoppm(1),  xwdtoppm(1),  ppmtogif(1),  ppmtoilbm(1), ppm-
       topgm(1), ppmtops(1), ppmtorast(1), ppmtoxwd(1),  ppmarith(1),  ppmcon-
       vol(1),   ppmcscale(1),  ppmhist(1),  ppmquant(1),  ppmrotate(1),  ppm-
       scale(1), ppmshear(1), pnm(5), pgm(5), pbm(5)

AUTHOR
       Copyright (C) 1989 by Jef Poskanzer.

       Permission to use, copy, modify, and distribute this software  and  its
       documentation  for  any purpose and without fee is hereby granted, pro-
       vided that the above copyright notice appear in(1,8)  all  copies  and  that
       both  that  copyright  notice and this permission notice appear in(1,8) sup-
       porting documentation.  This  software  is  provided  "as  is"  without
       express or implied warranty.



                               05 September 1989                        ppm(5)

References for this manual (incoming links)