How to C#: Imaging
Using Imaging SDK for C#.NET
Winforms Controls
Image Load
Image Access and Modify
Image Compress
Image Compress
  |  
Home ›› XImage.Raster ›› C# Raster: Image Compress

C# Raster - Image Compression in C#.NET


Explain Image Compression in C#.NET




Overview



All RasterEdge engineers and programmers are committed to developing and perfecting documents and images encoding and decoding toolkits in long term. This page is designed to show the general guide on how to compress and decompress images and documents in multiple C#.NET programs. You may have heard of image lossy and lossless compression, and we will give more info on them at the bottom of the tutorial page. Our C#.NET Imaging Compressing SDK ensures users with huge abilities to read and write images in lossy or lossless compression model in C# applications.




Supported Compression Methods



The compression methods be supported by XImage.Raster are as follows:


Bzip


     The value is 2. The RasterImage will use the Burrows-Wheeler algorithm, Named Bzip2 yet.


DXT1


     The value is 3. It is also known as Block Compression1 or BC1.


DXT3


     The value is 4. It is collectively also known as Block Compression 2 or BC2 converts 16 input pixels(corresponding to a 4*4 pixel block) into 128 bits of output.


DXT5


     The value is 5. It is collectively also known as Block Compression 3 or BC3 converts 16 input pixels into 128 bits of output.


Fax


Group4


     The value is 7. It is known as CCITT Group4 fax compression.


JPEG


     The value is 8.


JPEG2000


     The value is 9.


LosslessJPEG


     The value is 10. It is a class of data compression algorithms that allows the original data to be perfectly reconstructed from the compressed data


LZW


     The value is 11. It is lempel, Ziv, Welch compression algorithm.


RLE


     The value is 12. It is run length encoding.


Zip


     The value is 13. It is an archive file format that supports lossless data compression.


ZipS


     The value is 14.


Piz


     The value is 15.


Pxr24


     The value is 16. The PXR24 compression scheme used in Industrial Light & Magic's Open EXR file format is based on Carpenter's work.


B44


     The value is 17. B44 This form of compression is lossy for half data and stores 32bit data uncompressed.


B44A


     The value is 18. An extension to B44 where areas of flat color are further compressed. Regular B44 compresses uniformly regardless of image content.


LZMA


     The value is 19. An algorithm used to perform lossless data compression.


JBIG1


     The value is 20. A lossless image compression standard from the Joint Bi-level Image Experts Group.


JBIG2


     The value is 21. An image compression standard for bi-level images, developed by the Joint Bi-level Image Experts Group.


Undefined


     The value is 0. It is not support compression.


No


     The value is 1. It represents no compression.




Image Compression In C#.NET



Sample code compression image with fax compression format:




            RasterImage image = new RasterImage(@"F:\input.tif");
            ImageProcess process = new ImageProcess(image);
            process.TransformCompression(Compression.Fax);
            image.Save(@"F:\Test.tif");




Sample code compression image without compression format:




            RasterImage image = new RasterImage(@"F:\input.tif");
            ImageProcess process = new ImageProcess(image);
            process.TransformCompression(Compression.No);
            image.Save(@"F:\Test.tif");