The WRITE_JPEG2000 procedure writes image data into a JPEG2000 file. This procedure is a wrapper around the IDLffJPEG2000 object interface that presents JPEG2000 image writing in a familiar way to users of the WRITE_* image routines. However this procedure is not as efficient as the object interface and the object interface should be used whenever possible. See “IDLffJPEG2000” for information about the object interface.
For an example, see READ_JPEG2000.
WRITE_JPEG2000, Filename, Image [, Red, Green, Blue] [, N_LAYERS=value] [, N_LEVELS=value] [, /ORDER] [, /REVERSIBLE]
A scalar string containing the full path and filename of the JPEG2000 file to write. If the file suffix is .jp2 or .jpx (case insensitive), the file is written using the JP2 file format. Otherwise the file is written as a raw JPEG2000 code stream.
A byte or integer array of either two or three dimensions, containing the image to be written. Single channel images must have dimensions of [Width, Height]. Multi-channel images must have dimensions of [nComponents, Width, Height], where nComponents is the number of components present in the image.
Red, Green, Blue
For single-channel images, Red, Green, and Blue should contain the red, green, and blue color vectors to be stored within the JPEG2000 palette. For multi-channel images, these arguments are ignored.
Set this keyword to a positive integer specifying the number of quality layers. Each layer contains the information required to represent the image at a higher quality, given the information from all the previous layers. A larger number of layers takes longer to encode and produces a larger file, but provides more flexibility when decoding. The default is 1. If N_LAYERS is greater than1, the layers will be assigned roughly logarithmically-spaced bit rates, with the last layer containing all of the compressed bits.
Set this keyword to an integer specifying the number of wavelet decomposition levels, or stages, in the range of 0...15. A value of zero indicates that no wavelet transform will be used. Higher values will typically give better compression. If this keyword is omitted, then the default value of 5 is used. If the file is in JP2 format, and a Red, Green, Blue palette is present, then the default is N_LEVELS=0.
JPEG2000 images are assumed to be stored in top-to-bottom order, while IDL usually assumes images are in bottom-to-top order. By default (ORDER = 0), WRITE_JPEG2000 will automatically flip the input arrays to match JPEG2000's top-to-bottom order. Setting ORDER to a nonzero value will save the image directly to the JPEG2000 file without doing the vertical flip.
Set this keyword to specify that reversible (lossless) compression should be used. The default is to use irreversible (lossy) compression. If the file is in JP2 format, and a Red, Green, Blue palette is present, then the default is REVERSIBLE=1.