Category
Function
Writes an image to a file.
Syntax
WriteImage(image, name, format, frame);
Inputs
Name | Type | Default | Description |
---|---|---|---|
image | image or image series | none | the image to be written |
name | string | "image" | file name |
format | string | "rgb" or input dependent | format of file |
frame | integer | format dependent | frame to be written |
Functional Details
This module writes an image or series of images to disk.
Note: | If you are using the Image tool, the functionality of this module is available in the Save Image... option of the Image window's File pull-down menu (see "Saving an Image" in IBM Visualization Data Explorer User's Guide). |
image | specifies the image to be written to a file on disk. |
name | specifies the name of the file to be written to. |
format | specifies the format in which the image is to be written. The image file format can be specified by the file extension in name or by format. If these specifications conflict, format takes precedence. If the format is one of RGB, R+G+B, YUV, or MIFF, and the given file exists, the image(s) are appended to the file. Otherwise, a new file is always created. The format parameter allows specification of gamma for all format types. The default gamma is 2. (This is a change from previous releases for which gamma was always 1.) The format parameter also allows specification that a "delayed colors" image should be written, for all formats other than RGB, R+G+B, and YUV. See PostScript for a description of how to specify these two options.
|
frame | specifies a frame number in the file on disk. The first frame of a disk file or series is frame number 0 (zero). Its interpretation varies with the format being used. If the format is one of RGB, R+G+B, or YUV, then frame indicates the starting image frame in the disk file at which the given image or image series should be written. If the frame does not exist in the given file (this is the same as the file not existing), then the file is extended to contain the frames just before the indicated frame number. The contents of the frames that were created to extend the file are undefined. If frame is not provided, then the input image(s) are appended to an existing file. If the file does not exist it is created with the given image(s). For the TIFF and PostScript formats, if frame is specified, it is used to modify the output file name. For example, if frame = n, the name is modified from name.tiff to name.n.tiff. If the image is a series, all frames will be written to this file. |
See Table 9 for the recognized formats. PostScript** formats may include additional modifiers, separated from the format name by white space. See PostScript for the recognized modifiers. The following example sets the format to PostScript and specifies a page size of 4x5 and gamma=1.
WriteImage(y,name,"ps page=4x5 gamma=1");
The RGB ("rgb" and "r+g+b") and YUV formats allow an existing file to be modified, either by overwriting existing frames or by extending the number of frames in the file. The TIFF and PostScript formats do not support this capability. MIFF allows appending of images (but not overwriting of images).
Table 9 summarizes the characteristics of each format.
Descriptive sections follow the table.
Table 9. Format
Characteristics for WriteImage
File Type | Format Specifier | Resulting File Extension(s) | Multiframe/ Series Data | Modify an Existing File |
---|---|---|---|---|
gif | "gif" | .gif | No | No |
rgb | "rgb"
"r+g+b" | .rgb and .size
.r, .g, .b, and .size | Yes | Yes |
TIFF | "tiff" | .tiff | Yes | No |
yuv | "yuv" | .yuv | Yes | Yes |
Color PostScript | "ps color"
"ps" | .ps | Yes | No |
Gray PostScript | "ps gray"
"ps grey" | .ps | Yes | No |
Color PostScript
(Encapsulated) | "eps"
"eps color" | .epsf | No | No |
Gray PostScript
(Encapsulated) | "eps gray"
"eps grey" | .epsf | No | No |
MIFF | "miff" | .miff | Yes | Yes |
Note: If you are writing out images for use later from within Data
Explorer, you
will probably want to set gamma correction to 1 (the default is 2).
Otherwise, images will be doubly gamma-corrected. (Gamma correction at
display time can also be controlled using the DXGAMMA
environment variable; see C.1 , "Environment
Variables" in IBM Visualization Data Explorer User's Guide). For
printing or viewing images in another package, use gamma appropriate for
that device.
See Also
[Data Explorer Home Page | Contact Data Explorer | Same document on Data Explorer Home Page ]