Skip to contents

This function converts an image to one of the color : gray, red, green, blue

Usage

ColorConv(img, color)

Arguments

img

path of the input image from package jpeg's function readJPEG().

color

desired color to convert: gray, red, green, blue

Value

The converted image

Examples

img <- array(runif(1000),dim=c(10,10,3))
ColorConv(img, color = 'gray')
#> [1] 0.5150383