This is how to use the Pixmap library to read in an image as a matrix.
> library(pixmap) # the next command may only work on Linux > system("convert foo.tiff foo.ppm") > img
To get info on your new object:
Although included in the previous output, the size of the image can be extracted by:
Then to extract the red channel from the image for the first ten rows:
Or to extract the entire red channel to an actual matrix:
> red.mat red.mat