meta data for this page
WriteImage
WriteImage writes the image it receives to a file, in one of six formats. The file name must end in the format's extension.
| Format | Extension | Data it can hold | Best for |
|---|---|---|---|
| TIFF | .tif | 8- or 16-bit integers, or 32- or 64-bit floating point | archiving |
| ENVI | .hdr | 8- or 16-bit integers, or 32- or 64-bit floating point | computations |
| JPEG | .jpg | 8-bit monochrome or color (1 or 3 bands) | display only |
| PNG | .png | 8-bit monochrome or color | |
| BMP | .bmp | 8-bit monochrome or color | |
| Text | .txt | a simple text format unique to Hoku |
To write an image for display in other programs, first convert it to 8-bit with Pack.
WriteImage passes the image on unchanged, so you can connect another module after it. Each output file name can be used only once in a job.
JPEG
JPEG files use lossy compression. The “quality” parameter goes from 0.0 (lowest quality, smallest file) to 1.0 (highest quality, largest file). The default is 0.75.
TIFF
TIFF files are written uncompressed by default. Two lossless compression options are available, LZW and Deflate. Both can be combined with Differencing (the “predictor”) for more compression. Deflate with Differencing gives the best compression. LZW is provided for compatibility, but is not recommended.
ENVI
An ENVI file is a header file (.hdr) plus a data file. The “interleave” parameter sets how the data is written:
- BSQ (band sequential, the default) is best when you want to look at one band at a time.
- BIP (band interleaved by pixel) lets you look at all bands at once, as in a spectrum.
- BIL (band interleaved by line) is a compromise in access speed.
For writing a multispectral image, see Multispectral Image in ENVI.