Q:

How to use R for basic image processing

I am currently working on an application of Principal Component Analysis to visual data in R.
In Matlab, one can invoke commands such as "im2double" and "mat2gray" to convert a bitmap into a numerical matrix and back again to an image. 
I was wondering whether this can be achieved in R, maybe via additional packages. 

A:

I've used the EBImage package (vignette here) available on bioconductor to work with and manipulate images:
# installing package if needed
source("http://bioconductor.org/biocLite. R")
biocLite("EBImage")

library(EBImage) 
f = readImage(system.file("images", "lena-color.png", package="EBImage"))
str(f)
#Formal class 'Image' [package "EBImage"] with 2 slots
#  ..@ .Data    : num [1:512, 1:512, 1:3] 0.886 0.886 0.875 0.875 0.886 ...
#  ..@ colormode: int 2

