read.image              package:EBImage              R Documentation

_I_m_a_g_e _I/_O

_D_e_s_c_r_i_p_t_i_o_n:

     Functions to choose, read and write images from/to files and
     URL's.  Supported image formats are determined by the ImageMagick
     installation.

_U_s_a_g_e:

       choose.image()
       read.image(files, colormode = Grayscale, ...)
       write.image(x, files, quality, ...)

_A_r_g_u_m_e_n_t_s:

       x: An object of 'Image-class'. 

   files: A character vector of files/URL's to read from or to write
          to. 

colormode: An integer value for the color mode of images after they are
          read. By default all images will be converted to Grayscale on
          read. 

 quality: A numeric in the range '[1,100]' defining the quality of
          non-lossless compression, such as JPEG, when saving images.
          Higher values correspond to better quality.

     ...: Reserved for future use. 

_D_e_t_a_i_l_s:

     If 'files' is missing when writing images, 'fileName(x)' method
     will be used to select a single file to write to. Otherwise, the
     length of this vector must be equal either 1 or the number of 2D
     images in the stack.

     The file format is deduced from the file name extension(s), there
     is neither a need nor a way to specify the format explicitly.

     'ImageMagick' is used to perform all image I/O operations.
     Therefore, the package supports all the file types supported by
     'ImageMagick'.

     When reading images, files of different formats can be mixed in
     any  consequence, including mixing single 2D images with TIFF
     image stacks.  The result will contain a stack of all images and
     stacks cropped (filled with background if images are smaller) at
     the size of the first image read.

     'choose.image' is an interactive function that does not return to
     R until either Ok or Cancel button is pressed in the GUI dialog.
     It uses  'GTK+2' File Open Dialog to select images. Multiple
     images can be  selected and loaded at once. By default this
     functions reads images as 'TrueColor'. This function will produce
     an error message if  the package was compiled without 'GTK+'
     support.

_V_a_l_u_e:

     For 'read.image' a new instance of 'Image-class'.

     For 'choose.image' a new instance of  'Image-class' in the
     'TrueColor' mode.

     For 'write.image' an invisible 'NULL'.

_A_u_t_h_o_r(_s):

     Copyright (c) 2005-2006 Oleg Sklyar : osklyar@ebi.ac.uk

_R_e_f_e_r_e_n_c_e_s:

     _ImageMagick_: <URL: http://www.imagemagick.org>.

_S_e_e _A_l_s_o:

     ' Image-class, Image, channel '

_E_x_a_m_p_l_e_s:

       if ( interactive() ) {
         ddir <- paste( system.file(package="EBImage"), "images", sep="/" )
         a <- read.image( paste(ddir, c("A04w0.jpg", "A04w1.jpg"), sep="/") )
         url <- c("http://www.google.com/intl/en/images/logo.gif")
         im <- read.image (url, TrueColor)
         ## Not run: write.image (im, "googlelogo.tif")
         ## Not run: im1 <- channel ( choose.image(), "gray")
       }

