Compression Using LEAD and JPEG Formats
Compression of color and grayscale graphic image files is useful because the files are big. They can range from 100 kilobytes to more than 200 megabytes. Compressing the image files does the following:
Dramatically decreases the storage requirements
Improves the input and output speed within a system
Improves the transmission speed over networks or phone lines
By incorporating the LEAD and JPEG image compression, you can develop applications that would be impractical otherwise. Image files can be reduced to 200 times smaller than their original size.
The LEAD CMP compression format was created by LEAD Technologies, Inc., and it delivers a much smaller file size and better image quality than other compression techniques, including JPEG.
LEAD's CMP file format allows for decompression to a 24-bit medium at 24-bit color and to an 8-bit medium at 8-bit color without sacrificing image quality. This eliminates the need to convert all images to 8 bits in order to support the low end users or to save one 8-bit file and one 24-bit file. The result is one much smaller file size that can be viewed on a 24-bit video card at 24-bit true color, as well as on an 8-bit VGA card at 256 colors.
LEAD's CMW format uses Wavelet CMP compression. Currently, 24 color images and 8, 12 and 16-bit grayscale images are supported in this format. (This is available only in the LEADTOOLS CMW Plug in. 12 and 16-bit formats also require the Document/Medical capabilities)
Summary of All Supported Image File Formats describes the LEAD and JPEG compression formats, in addition to other formats that LEADTOOLS supports.
The amount of compression is controllable, allowing the compressed image quality to match the needs of your application. Compression Quality Factors describes how the quality factors are used.
JPEG Compliant
LEADTOOLS Class Library is fully JPEG compliant. Any file using compression that is compliant with the JPEG Interchange File Format can be viewed and converted.
However, some images that are not fully compliant with the JPEG specification will be displayed upside-down. (The JPEG Interchange File Format specifies that all images must be stored top-down.) You can change the orientation of an image by modifying the ViewPerspective flag in the LEAD bitmap handle.
JPEG 2000 Compliant
LEADTOOLS Class Library can load and save JPEG 2000 files. You can load 24-48 bit color images (images with 25-47 bits/pixel will be loaded as 48-bit). You can load 8-16 bit grayscale images. Images with 9-11 bits/pixel will be loaded as 12-bit while images with 13-15 bit are loaded as 16 bits/pixel.
You can save 24 and 48-bit color images and 8, 12 and 16-bit grayscale images.
LEADTOOLS supports JPEG2000 stream (J2K) and JP2 format files. LEADTOOLS supports the mandatory boxes of the JP2 format only.
4 and 1-bit Images
JPEG and LEAD CMP compression are intended for use with high resolution images, and they are impractical for use with 4- or 1-bit images.
You can use the CCITT, LEAD 1-bit, RLE, LZW, and ZIPLib compression methods available in many of LEADTOOLS supported formats.
8 and 24-bit Images
Using JPEG, JPEG2000 and LEAD CMP or CMW compression, color images are 24 bits per pixel, and grayscale images are 8 bits per pixel. Therefore, to compress an 8-bit color image, the internal JPEG, JPEG2000 and LEAD CMP or CMW compression functions must convert the 8-bit data into raw RGB 24-bit before compressing it as a color image.
Compressing the original 24-bit image will result in a smaller file size and higher quality than compressing an optimized 8-bit color image.
LEADTOOLS functions compress 8-bit grayscale as 8-bit grayscale JPEG or CMP images.
You can use RLE, LZW and ZIPLib (PNG) compression methods available in many of LEADTOOLS supported formats.