write.image {imageio}R Documentation

Read/write various image formats

Description

Reading and writing of various types of image file as pixmap objects, using netpbm to do the hard work

Usage

img <- read.image(filename,fformat=NULL,opts="",...)
write.image(img,filename,fformat=NULL,opts="",...)

Arguments

filename Name of the image file.
img Object of class pixmap
opts Command-line options passed to the netpbm program used
... Extra arguments to be passed to read.pnm or write.pnm
fformat Code for the file format to read or write. Valid values are png, jpg, tiff. On unix systems, read.image also accepts fformat=auto, this is used as the default. The fformat=auto option does not work under MicroSoft Windows, so a default of "png" is used.

Details

read.image reads a large variety of image types, returning an object of class pixmap.

write.image writes an object of class pixmap to a file in one of several common image file formats.

Note

Both read.image and write.image work by using read.pnm or write.pnm to move the data between R and a temporary file. Programs in the netpbm package are used to convert from temporary file to the desired format or vice versa. You therefore need to have netpbm installed for either of these programs to work. For Windows, you can obtain this from http://gnuwin32.sourceforge.net/. With most unixes and Linux distributions you will find it packaged for your distribution. If not, you can get it at http://netpbm.sourceforge.net/. The imageio package does not check for the presence of netpbm when installed. We hope to fix this in a subsequent release.

Author(s)

Hugh C. Pumphrey H.C.Pumphrey@ed.ac.uk


[Package imageio version 0.01 Index]