write.image {adimpro} | R Documentation |
Write an image file.
write.image(img, file = "tmp.ppm", max.x=NULL, max.y=NULL, depth = NULL,color.par = NULL, alg = 1, convert.path = "convert")
img |
image data, an object of class "adimpro". | ||||||||||||||||||
file |
file name, the extension determines the image file format. | ||||||||||||||||||
max.x |
maximum value of pixels in x dimension. | ||||||||||||||||||
max.y |
maximum value of pixels in y dimension. | ||||||||||||||||||
depth |
color depth, either 8 or 16 (bit)! The value is reset to 8 if the specified image file format does not allow for 16 Bit encoding. | ||||||||||||||||||
color.par |
list of parameters for the gamma correction and some
white balance. list entries:
| ||||||||||||||||||
alg |
chooses computing algorithms which differ in speed and precision. | ||||||||||||||||||
convert.path |
Windows system calls seem to change environment variable PATH, such that "convert" points to c:\windows\system32\convert.exe instead of ImageMagick-x.x.x\convert. Therefore here the full path must be provided. Backslash needs to be escaped: c:\\programs\\imagemagick-6.3.0\\convert |
This function writes the image data in img
to the file
file
. Color depth depth
is used for writing, but if
image has a component "depth", this argument will be ignored. Note: Not
all target formats support 16bit coding. The target format is
determined from the file extension, and should be one of the many that
ImageMagick supports.
If color.par$red
or color.par$blue
or color.par$brightness
differ from 1.0 the
corresponding channels are multiplied with the provided
values. Saturated values are set to 1.
If img$gamma
is FALSE, perform gamma correction with
color.par$ga
and color.par$bp
. alg
chooses between three different
computing algorithms (approximations) with increasing computation time
and precision (alg
is 1,2, or 3).
Nothing is returned.
ImageMagick has to be installed on the system to write "tif", "tiff", "png", "gif", "jpg" or "jpeg" files.
Karsten Tabelow tabelow@wias-berlin.de