Exports a cube to PNG, BMP, TIFF, JPEG, or JPEG 2000
This program exports an ISIS cube to one of several popular standard image
formats. The current supported formats are BMP, JPEG, JP2, PNG, and TIFF.
This program uses TrollTech's version of the Qt Library to export BMP
and JPEG formatted output images. For these format types, due to limitations of Qt, the
input file size must not exceed 2 gigabytes and the only valid output bit type is 8-bit.
The JPEG2000 (JP2) and TIFF formats do not depend on the Qt library. These formats do not
have the 2 GB limitation for input files and the output bit type may be 8-bit, U16-bit or S16-bit.
For these formats, the writing routines output are streamed lines from the cube, and little
of the image is held in memory at any one time, therefore increasing the processing speed to
convert the file. It is recommended that large images are exported to JP2 or TIFF format.
For some output image types, users may specify a value for the level of compression
represented as a percentage using the QUALITY parameter. The default is no compression
(i.e. QUALITY = 100%). For the TIFF format a compression algorithm can be selected.
Each of the input cube parameters (FROM, ALPHA, RED, GREEN, and BLUE) requires a single band
from an ISIS cube. If a cube contains multiple bands, the user must specify a single band of
the input image. To do this, the user must append a plus sign and the band number to be used
to the input file name. For example, inputFile.cub+4 indicates that the 4th band in the cube
will be used. No band needs to be specified if the cube only has a single band.
In addition, if the cube has Mapping labels, the program will produce a world file for use
in Arc and/or other GIS packages. The file will have an extension that uses the first and
last letters for the image extension and a "w". For example, .tif produces a world file
extension of .tfw.
To ensure acceptable contrast in the output file, the user may select from three stretch
options: linear, piecewise-linear, or manual.
Special pixels such as Low Saturation values and Nulls are set to black and High Saturation
values are set to white. See the BITTYPE parameter documentation for more information about
which output pixel values are assigned for particular input DNs of the various bit types.
Added two new modes (rgb and argb) and updated the appTest.
Added MIN and MAX percent options
Added seperate MINIMUM and MAXIMUM parameters for all channels.
Modified to use Filename class, and added appropriate appTest
Modified to give an error if write fails. Memory leak fixed.
Modified so that ISIS Null pixels are written as zeros in the output cube
and low data in the input is written as a one
Added a check to see that raw image data will be less than 4GB.
Throw exception if it is too big.
Removed references to CubeInfo
Added QUALITY parameter to set compression levels
Fixed checkDataSize() since Qimage has a maximum size of 2 GB, not 4GB.
Added some QT error catching.
Added support for JPEG2000 files.
Stuart Sides and Steven Lambright
Added minimum and maximum input stretch values and output file
name to the output log. fixes #761
Added support for exporting cubes greater than 2GB to TIFFs.
Fixed some problems with the big tiff exports that caused
corrupt outputs. The 2GB limitation should be removed
completely now. References #579.
Fixed bug where alpha channel was not being utilized for ARGB option. Fixed bug that mapped
Nulls as the min value for TIFF and JP2 formats. Changed ImageExporter calls to new method
names, where needed. Added test for ARGB parameter. Added xml example. Added appTests to
improve coverage for isis2std program and the ImageExporter and its derived classes.
Changed default compression of TIFF format images to no compression. Added COMPRESSION parameter to
choose the compression algorithm for TIFF format images. Fixes #1745
Removed the option to export as a GIF because Qt does not support GIF
exports. Fixes #1667.
This parameter is used to select the output format. It can be one of
PNG, BMP, JPEG, TIF, or JP2. Note that not all formats may be
available. It will depend on your installation of the Qt libraries.
In addition, if the cube has Mapping labels, the program will produce
a world file for use in Arc and/or other GIS packages. The file will
have an extension that uses the first and last letters for the image
extension and a "w". For example, .tif produces a world file extension of .tfw.
Output image will be PNG
The output image is in PNG (Portable Network Graphics) format. The default extension
for this format is "png."
Output image will be BMP
The output image is in BMP (Bit Mapped Graphics) format. The default extension for
this format is "bmp."
Output image will be TIFF
The output image is in TIFF (Tagged Image Files Format) format. The default extension
for this format is "tif."
Output image will be JPEG
The output image is in JPEG (Joint Photographic Experts Group) format. The default
extension for this format is "jpg."
Output image will be JPEG2000
The output image is in JPEG2000 (Joint Photographic Experts Group 2000) format. The
default extension for this format is "jp2."
This parameter allows the user to specify level of quality
(compression) for the output image. Some output image types may not
utilize this parameter. The range is from 100 (no compression and
highest quality) to 0 (highest compression and reduced quality). A
value of -1 can be given to use the default settings.
This parameter allows the userPackBits is also known as Macintosh RLE. to set the bit type of the output image.
Some FORMAT values will only allow 8-bit outputs.
16 bit signed (-32767=black, 32768=white)
Output is 8 bit unsigned integer data
Pixels values are within 8-bit unsigned integer data range from 0 to 255.
Output is 16 bit unsigned integer data
Pixel values are within the 16-bit unsigned integer data range from 0 to 65535. This
option is not available for some output formats.
Output is 16 bit signed integer data
Pixel values are in 16-bit signed integer data range -32768 to 32767. This option is
not available for some output formats.
The compression algorithm used to compress an output TIFF format image. Only used if the format
is set to TIFF. The default is no compression. PACKBITS is the most widely supported compression
algorithm for the TIFF format.
Use no compression
Use no compression on the output TIFF image.
Use PackBits compression
Use PackBits compression on the output TIFF format image. PackBits is also known as Macintosh RLE.
This compression algorithm should be supported by all TIFF readers that conform to the
Baseline TIFF specification.
Use LZW compression
Use Lempel-Ziv-Welch(LZW) compression on the output TIFF format image.
Use Deflate compression
Use Deflate compression on the output TIFF format image.
Note: This uses the official version of Deflate for TIFF images described in the
TIFF Specification Supplement 2. Other versions of deflate for TIFF images are considered
This parameter is used to select one of three ways to stretch (or map)
output pixels. The are LINEAR, PIECEWISE, or MANUAL.
A minimum and maximum are automatically computed based on the
statistics of the selected band. A histogram of the band is used
to pick the minimum at 0.5% of the data and the maximum at 99.5%
of the data. Input pixels less than or equal to the minimum are
stretched to black while pixels greater than or equal to the
maximum are stretched to white. A linear mapping occurs between
the minimum and maximum.
This option is similar to the LINEAR option. A minimum and
maximum are automatically computed. Additionally, the median is
computed and it is mapped to the middle gray value (halfway
between white and black). Therefore, it is a piecewise-linear
stretch with input pixels mapped linearly between either 1) the
minimum/median or 2) the median/maximum. This option is useful
for contrast stretching cubes with skewed histograms to ensure a
This option allows you to pick your own stretch. You must
enter a value for MINIMUM and MAXIMUM
Example of red/green/blue output of isis2std program.
This example creates an output TIFF format file from 3 bands of an ISIS cube, designated
red, green, and blue using a linear stretch and 8-bit output type. A histogram is created
from the input values. Using this histogram, we determine the minimum value to be any DN
in the bottom 0.2% of the data. These DNs will be set to black in the output. Similarly,
the maximum value is any DN in the top 99.8% of the data and these DNs will be set to white.