write.image {adimpro}R Documentation

I/O Functions

Description

Write an image file.

Usage

write.image(img, file = "tmp.ppm", max.x=NULL, max.y=NULL, depth = NULL,color.par = NULL,
            alg = 1, convert.path = "convert")

Arguments

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:
ga gamma value default 2.4
bp break point default 0.00304
alg algorithm for gamma correction default 1
red factor to multiply with red channel. default 1.0
blue factor to multiply with blue channel. default 1.0
brightness factor to multiply with all channels default 1.0
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

Details

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).

Value

Nothing is returned.

Note

ImageMagick has to be installed on the system to write "tif", "tiff", "png", "gif", "jpg" or "jpeg" files.

Author(s)

Karsten Tabelow tabelow@wias-berlin.de

See Also

read.image


[Package adimpro version 0.4.4 Index]