| as.RGBImage.GrayImage {R.image} | R Documentation |
Converts a grayscale image to an RGB image.
## S3 method for class 'GrayImage': as.RGBImage(this, coefs=c(1, 1, 1), ...)
coefs |
The coefficients that the gray values should be multiplied with for the red, green and the blue channel, respectively. |
... |
Not used. |
Returns a RGBImage object.
Henrik Bengtsson (http://www.braju.com/R/)
For more information see GrayImage.
gray <- BitmapImage$read("logosm-gray.pgm", path=system.file("images", package="R.image"))
rgb <- as.RGBImage(gray)
red <- as.RGBImage(gray, coefs=c(1,0,0))
layout(matrix(1:4,ncol=2))
image(gray)
image(rgb)
image(red)