# NOT RUN {
data(twelve)
par(pty = "s", mfrow = c(1,3))
plot(as.raster(twelve)) # in RGB
title(main = "original", font.main = 1)
x <- RGB2gray(twelve, method = "RMY")
plot(as.raster(x)) # in grayscale
title(main = "RMY", font.main = 1)
x <- RGB2gray(twelve, method = "ITU")
plot(as.raster(x)) # OMG! 12 is gone...
title(main = "ITU", font.main = 1)
# }
Run the code above in your browser using DataLab