[R] R interface to ImageMagick

Charles C. Berry cberry at tajo.ucsd.edu
Sat Apr 29 06:00:20 CEST 2006



> RSiteSearch("imagemagick")

reveals a few functions whose help pages reference ImageMagick and R-help 
postings that pertain to image manipulation.

However, I did notice anything that amounts to an 'interface'.

Certainly, you can use 'shell' to run command line tools like 'convert' et 
cetera and to query files using 'identify'. For example to resize a bunch 
of images and store them in a directory 'quarter' (on a Windows system), 
this works:

hpim.files <- list.files(".","^hpim.*")
dir.create("quarter")
convert.cmd <- 'convert  #in  -resize "540x540>" quarter\\#in'
for ( i in hpim.files ) {
   shell( gsub( "#in", i, convert.cmd ), shell=Sys.getenv("COMSPEC"))
}


Chuck

On Thu, 27 Apr 2006, Swidan, Firas wrote:

> Hi,
>
> I was wondering if anyone is aware of an R interface to ImageMagick
> (www.imagemagick.org)? Since R does not support a lot of image processing
> functions, having such an interface could be very useful. Alternatively,
> ImageMagick has a couple of different interfaces (including to C and C++). I
> was wondering if one can use these to call ImageMagick functions from R.
>
> I am posting a similar question on the imagemagick mailing lists too.
>
> Thanks for the help,
> Firas.
>
>
>
>
>    [ Part 3.60: "Included Message" ]
>

Charles C. Berry                        (858) 534-2098
                                          Dept of Family/Preventive Medicine
E mailto:cberry at tajo.ucsd.edu	         UC San Diego
http://biostat.ucsd.edu/~cberry/         La Jolla, San Diego 92093-0717




More information about the R-help mailing list