PNM Files
    
    
    
      PNM is a data directory which
      contains examples of PNM files.  "PNM" stands for "Portable Any
      Map" and is intended to cover all six variations of Jef Poskanzer's
      portable bit/gray/pixel maps, (PBM, PGM, and PPM) whether ASCII or binary.
    
    
      PNM File Characteristics:
    
    
      
        - 
          ASCII (P1, P2, P3) or binary (P4, P5, P6)
        
 
        - 
          B/W (P1 or P4), Gray (P2 or P5), or Color (P3 or P6)
        
 
        - 
          2D
        
 
        - 
          No compression
        
 
        - 
          1 image
        
 
      
    
    
      Licensing:
    
    
      The computer code and data files described and made available on this web page
      are distributed under
      the GNU LGPL license.
    
    
      Related Data and Programs:
    
    
      The PBMA data directory
      describes the ASCII Portable Bit Map format.
    
    
      The PBMB data directory
      describes the binary Portable Bit Map format.
    
    
      The PGMA data directory
      describes the ASCII Portable Gray Map format.
    
    
      The PGMB data directory
      describes the binary Portable Gray Map format.
    
    
      The PPMA data directory
      describes the ASCII Portable Pixel Map format.
    
    
      The PPMB data directory
      describes the binary Portable Pixel Map format.
    
    
      Reference:
    
    
      
        - 
          the NETPBM homepage.
        
 
      
    
    
      Programs and routines to read a PNM file:
    
    
      
        - 
          MATLAB can read a PNM
          file with a command like A=imread('file','PNM').
        
 
      
    
    
      Programs and routines to write a PNM file:
    
    
      
        - 
          MATHEMATICA
          includes an Export[filename,object] command
          that can save a graphics object as a PNM file.
        
 
        - 
          MATLAB can write a PNM
          file with a command like imwrite(a,'filename','PNM').
        
 
      
    
    
      Programs to display a PNM file include:
    
    
      
        - 
          The AVS
          module read_any_image can display a PNM file.
        
 
        - 
          GIMP,
          the GNU Image Manipulation Program, can display a PNM file.
        
 
        - 
          xv can display a PNM file.
        
 
      
    
    
      Programs to convert a PNM file to another format:
    
    
      
        - 
          The
          ImageMagick,
          program convert can convert a PNM file to
          BMP, CGM, EPS, FIG, FITS, GIF, JPG, PBM, PDF, PGM, PNG,
          PPM, PS, RGB, TIF, XBM or XPM format.
        
 
        - 
          GIMP,
          the GNU Image Manipulation Program,
          can read a PNM file
          and write out a copy in a variety of formats.
        
 
        - 
          The NETPBM program 
          pnmtopng
          can convert a PNM file to a PNG file.
        
 
        - 
          The Visualization Toolkit
          routine vtkPNMReader can read a
          PNM file into VTK.
        
 
      
    
    
      Programs to convert a file to PNM format:
    
    
      
        - 
          The
          ImageMagick,
          program convert can convert a
          BMP, CGM, EPS, FIG, FITS, GIF, JPG, PBM, PDF, PGM, PNG,
          PPM, PS, RGB, TIF, XBM or XPM file to PNM format.
        
 
        - 
          the program giftopnm can convert a GIF file to a PNM file.
        
 
        - 
          GIMP,
          the GNU Image Manipulation Program, can read a file in a
          variety of formats, and write it out as a PNM file.
        
 
        - 
          The NETPBM program 
          jpegtopnm
          can convert a JPEG file to a PNM file.
        
 
        - 
          The NETPBM program 
          pngtopnm
          can convert a PNG file to a PNM file.
        
 
        - 
          The Visualization Toolkit
          routine vtkPNMWriter can write a VTK
          image to a PNM file.
        
 
        - 
          xv can save a PNM file
          as a BMP, FITS, GIF, JPEG, PS, RGB, or TIFF.
        
 
      
    
    
      Sample PNM Files:
    
    
      
        - 
          circle.pnm,
          a circle, type P1 (a PBMA file);
        
 
        - 
          circle2.pnm,
          a circle, type P4 (a PBMB file);
        
 
        - 
          rays.pnm,
          a pattern of rays, type P2 (a PGMA file);
        
 
        - 
          rays2.pnm,
          a pattern of rays, type P5 (a PGMB file);
        
 
        - 
          snail.pnm,
          a snail, type P3 (a PPMA file);
        
 
        - 
          snail2.pnm,
          a snail, type P6 (a PPMB file);
        
 
      
    
    
      You can go up one level to
      the DATA page.
    
    
    
      Last revised on 29 January 2006.