x <- pixmapRGB(rep(1:5, 3), nrow=4)
plot(x)
print(x)
getChannels(x)
getChannels(x, colors=c("red", "green"))
y = addChannels(x)
plot(y)
print(y)
## extract only the red channel
y = addChannels(x, coef=c(1,0,0))
plot(y)
Run the code above in your browser using DataLab