Saving JPEG 2000 and JPX Images in Lossless Mode
Lossless compression is used in sensitive applications, such as legal or medical. Lossless compression provides lower compression rates than even the maximum quality lossy compression. However, JPEG 2000 lossless compression outperforms comparable lossless image compression techniques like LZW and TIFF. The format also allows storing several quality levels in an image, and in particular, using lossy compression for the lower quality levels and lossless compression for the highest quality layer.
The following actions are necessary to save a lossless JPEG 2000 or JPX image:
- Set WaveletFilter control parameter to ImGearJPEG2KFilters.REVERSIBLE to use the reversible color transform.
- Specify the maximum compression quality, by one of the following:
- Set RateBytes control parameter to 0, and QualityLayers control parameter set to default value, or
- Use the QualityLayers control parameter, and set the last entry in the array passed to it to 0.0. This results in an image where the first several layers are lossy, and the last layer is lossless.
If the maximum compression quality is used, the value of
QuantizationStep parameter is ignored, as no quantization takes place.
See JPEG 2000 and JPX file format descriptions for details on the control parameters mentioned above.