as.RGBImage.GrayImage {R.image}R Documentation

Converts a grayscale image to an RGB image

Description

Converts a grayscale image to an RGB image.

Usage

## S3 method for class 'GrayImage':
as.RGBImage(this, coefs=c(1, 1, 1), ...)

Arguments

coefs The coefficients that the gray values should be multiplied with for the red, green and the blue channel, respectively.
... Not used.

Value

Returns a RGBImage object.

Author(s)

Henrik Bengtsson (http://www.braju.com/R/)

See Also

For more information see GrayImage.

Examples

  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)

[Package R.image version 0.2.3 Index]