This is the persp method for the class "im".  The pixel image x must have real or integer values.
  These values are treated as heights of a surface, and the
  surface is displayed as a perspective plot on the current plot device,
  using equal scales on the x and y axes.
  The optional argument colmap gives an easy way to display
  different altitudes in different colours (if this is what you
  want). If colmap is a character vector, then the range of
  altitudes in the perspective plot will be divided into
  length(colmap) intervals, and those parts of the surface
  which lie in a particular altitude range will be assigned
  the corresponding colour from colmap. Alternatively if
  colmap is a list with entries breaks and col,
  then colmap$breaks determines the breakpoints of the altitude
  intervals, and colmap$col provides the corresponding colours.
  
  Graphical parameters controlling the perspective plot
  are passed through the ... arguments
  directly to the function persp.default.
  See the examples in persp.default or in
  demo(persp).