pnm                  package:pixmap                  R Documentation

_R_e_a_d/_W_r_i_t_e _P_o_r_t_a_b_l_e _A_n_y_m_a_p _I_m_a_g_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     Reading and writing of bitmap images in PBM (black/white), PGM
     (grey) and PPM (color) format.

_U_s_a_g_e:

     read.pnm(file, ...)
     write.pnm(object, file="Rimage.pnm", forceplain=FALSE,
               type=NULL, maxval=255)

_A_r_g_u_m_e_n_t_s:

    file: name of the pnm file.

     ...: Further arguments passed to `pixmap' (like `bbox').

  object: an object of class `"pixmap"'.

forceplain: If `TRUE', an ASCII pnm file is written. Default is to
          write a binary (raw) file.

    type: One of `"pbm"', `"pgm"' or `"ppm"'. Default is to use `"pgm"'
          for grey images and `"ppm"' for color images.

  maxval: The maximum color-component value, the default is a colour
          depth of 8 bits, i.e., the integer 255.

_D_e_t_a_i_l_s:

     `read.pnm' reads a pnm file and loads the image into an object of
     class `pixmap'.

     `write.pnm' writes an object of class `pixmap' to a pnm file, the
     `type' argument controls wheter the written image file is a
     black-and-white bitmap (pbm), grey (pgm) or color (ppm). 

     `plot.pnm' plots a pnm object using the command `image'. The only
     difference is that the element `[1,1]' of `pnmobj' is plotted as
     the upper left corner (plain `image' would plot `[1,1]' as the
     lower left corner.

_V_a_l_u_e:

     `read.pnm' returns an object of class `pixmapRGB' for color
     pixmaps (ppm), and an object of class `pixmapGrey' for pbm and
     pgm.

_A_u_t_h_o_r(_s):

     Roger Bivand and Friedrich Leisch

_S_e_e _A_l_s_o:

     `pixmap'

_E_x_a_m_p_l_e_s:

      x <- read.pnm(system.file("pictures/logo.ppm", package="pixmap")[1])
      plot(x)
      print(x)

      x <- read.pnm(system.file("pictures/logo.pgm", package="pixmap")[1])
      plot(x)

      x <- read.pnm(system.file("pictures/logo.pbm", package="pixmap")[1])
      plot(x)

