pixmap-class: Class Family "pixmap".

Description Objects from the Class Slots Details Author(s) See Also


The family "pixmap" (“pixel maps”) of classes provides methods for creating, plotting and converting bitmapped images in currently three different formats: RGB ("pixmapRGB"), grey ("pixmapGrey")and indexed pixmaps ("pixmapIndexed").

Objects from the Class

Objects can be created by calls of the form new("pixmap", ...) or using the creator functions pixmap (similar for all child classes of name ("pixmapXXX").



Object of class "integer" and length 2 (number of rows and columns).


Object of class "numeric" and length 2 specifying the cell resolution of each pixel in user coordinates.


Object of class "numeric" and length 4, the coordinates of the bounding box (x bottom, y bottom, x top, y top).


A character vector naming the channel slots of the object (NULL for indexed pixmaps).

red, green, blue:

Only for class "pixmapRGB" with matrices specifying the red, green and blue channel of the picture.


Only for class "pixmapGrey", a matrix specifying the grey intensity (0=black, 1=white) of the picture.


Only for class "pixmapGrey", a character vector with a map of color names.


Only for class "pixmapIndexed", an integer matrix with codes from the color map.


Class "pixmap" specifies the basic geometry of a picture: the size in pixels together with information for an optional coordinate system, see pixmap for details.

Grey and indexed pixmaps are besically matrices (contained in the grey or index slot, respectively). The element [1,1] corresponds to the upper left corner as usual. For grey pixmaps the elements must be between 0 (black) and 1 (white). Indexed pixmaps have integer elements, each giving the index number corresponding to the palette specified in slot "col". Colors are given using the usual R color strings (either names like "red" or hex values like "#FF0000"). Alternatively, a function to create a color palette can be specified, see rainbow or heat.colors for examples.

RGB pixmaps have three matrices for each of the three color channels. Elements of the matrices must be between 0 (=color off) and 1 (=color at maximum intensity).

Methods for coercion between all formats are available.

Class "pixmapChannels" is a helper parent class currently containing classes "pixmapRGB" and "pixmapGrey".


Friedrich Leisch

See Also


Search within the pixmap package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.