Generate an image from pixel assignments and color matrix
Source:R/constructImage.R
constructImage.Rd
Combines a matrix of pixel assignments and a corresponding matrix of colors to make a recolored RGB image.
Arguments
- pixel_assignments
A matrix of index values for each pixel which corresponds to
centers
(e.g. a1
indicates that pixel is the color of the first row ofcenters
). Pixels with an index value of 0 are considered background.- 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.