View source: R/constructImage.R
constructImage | R Documentation |
Combines a matrix of pixel assignments and a corresponding matrix of colors to make a recolored RGB image.
constructImage(pixel_assignments, centers, background_color = "white")
pixel_assignments |
A matrix of index values for each pixel which
corresponds to |
centers |
An n x 3 matrix of color centers where rows are colors and columns are R, G, and B channels. |
background_color |
A numeric RGB triplet, a hex code, or a named R color for the background. Will be masked by alpha channel (and appear white in the plot window), but will be revealed if the alpha channel is removed. If the alpha channel is a background mask, this is the 'baked in' background color. |
An image (raster) array of the recolored image, with four channels (R, G, B, and alpha).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.