Skip to content
Prev 20039 / 63424 Next

pixmaps and R

Dear Thibaut,

I am not sure what you want to do and what for you want to have a 
compressed version of an image in R. You can try the EBImage package, 
which is in the devel branch of bioconductor
http://www.bioconductor.org/packages/bioc/1.8/html/EBImage.html
It uses ImageMagick for image I/O and processing (so you need that, 
including header files and Magick++). It is still early in this 
package's life-cycle, so consider it an "alpha" version.

library(EBImage)
y = read.image(system.file("data", "cat.jpg", package="rimage"),
        rgb=TRUE)

object.size(y)
[1] 702888
 > dim(y)
[1] 418 420

and this is 4 Bytes (a 32 bit int of which only the lower 24 bits are 
used) per Pixel, rather than 24 Bytes (3 doubles) in the case below.

object.size(x)  ## your example from rimage
[1] 4214240

And there are some 2D filtering and image processing functions.

Cheers
   Wolfgang

-------------------------------------
Wolfgang Huber
European Bioinformatics Institute
European Molecular Biology Laboratory
Cambridge CB10 1SD
England
Phone: +44 1223 494642
Fax:   +44 1223 494486
Http:  www.ebi.ac.uk/huber
-------------------------------------
Thibaut Jombart wrote: