What is ppm

Bill Brown brown at zorro.cecer.army.mil
Fri Apr 8 10:40:23 EDT 1994


Here's an excerpt from some documentation that comes with San Diego
Supercomputing Center's imtools, available by ftp from:
ftp.sdsc.edu

----------------------------------



IMPPM(3IM)             SDSC IMAGE LIBRARY              IMPPM(3IM)


NOTES
     SDSC image library  support  of  the  ppm  format  does  not
     require  use  of  the PBM+ libraries and tools.  It does not
     contain proprietary code or any code  from  Jef  Poskanzer's
     original  PBM+  suite.   ppm format handling is available on
     any machine for which the SDSC image library is available.

     PBM (Portable Bit Map) started with support for 1-bit  mono-
     chrome images (see impbm(3IM)).  Support was added for 8-bit
     grayscale images (see impgm(3IM)), also called PGM (Portable
     Grayscale  Map),  and  24-bit  RGB  images,  also called PPM
     (Portable Pixel Map).  Each of these defined a new file for-
     mat.

     The original file formats were ASCII.  To  reduce  the  disk
     space  required  to store such files, three additional "raw"
     formats were defined.   The  raw  formats  stored  the  same
     information  as  their  ASCII  counterparts  but  in binary,
     reducing the  disk space requirement by around 60%.

     Today the PBM+ suite contains six related file formats:

          PBM    ASCII 1-bit bitmaps
          PGM    ASCII 8-bit grayscale pixel maps
          PPM    ASCII 24-bit RGB color pixel maps
          RPBM   Raw binary 1-bit bitmaps
          RPGM   Raw binary 8-bit grayscale pixel maps
          RPPM   Raw binary 24-bit RGB color pixel maps

     The original PBM suite included a variety  of  tools.   Some
     handled  PBM  files, but not PGM or PPM.  Others handled PGM
     files, but not PBM or PPM.  Then the newer PBM+ distribution
     introduced  a set of tools that recognized all six file for-
     mats.  These tools generically referred to  image  files  as
     PNM files, which stands for "Portable aNy Map."

     The SDSC image library treats  the  six  PBM+  file  formats
     separately.   This man page only discusses the PPM file for-
     mat (ASCII RGB).  The remaining file formats  are  discussed
     in their own man pages.

  Reading PPM image files
     For compatibility  with  the  PBM+  suite,  the  SDSC  image
     library  can  read any of the PBM+ file formats when the ppm
     format name is used.  PBM+ files are read in and  mapped  to
     VFBs as follows:

          File format   Depth/color         Mapped to VFB
          PBM           1-bit monochrome    IMVFBMONO without a CLT
          PGM           8-bit color index   IMVFBINDEX8 without a CLT
          PPM           24-bit RGB          IMVFBRGB without a CLT
          RPBM          1-bit monochrome    IMVFBMONO without a CLT
          RPGM          8-bit color index   IMVFBINDEX8 without a CLT
          RPPM          24-bit RGB          IMVFBRGB without a CLT

     White space, and comments starting with # and  extending  to
     the  end  of the line are ignored.  White space and comments
     are not allowed within the raw binary image body.

     ppm  images   are   always   stored   noninterlaced   (i.e.,
     RGBRGBRGB...).  Scanline- and plane-interlaced modes are not
     available in ppm files.

     ppm files support no compression schemes.

AUTHORS
     Dave Nadeau and Don Doering
     San Diego Supercomputer Center

CONTACT
     SDSC consultants, (619)534-5100, consult at y1.sdsc.edu



----------------------------------



More information about the grass-user mailing list