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 RasterImage will use the Burrows-Wheeler algorithm, Named Bzip2 yet.


DXT1


     It is also known as Block Compression1 or BC1.


DXT3


     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


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


Fax


Group4


     It is known as CCITT Group4 fax compression.


JPEG


JPEG2000


LosslessJPEG


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


LZW


     It is lempel, Ziv, Welch compression algorithm.


RLE


     It is run length encoding.


Zip


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


ZipS


Piz


Pxr24


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


B44


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


B44A


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


LZMA


     An algorithm used to perform lossless data compression.


JBIG1


     A lossless image compression standard from the Joint Bi-level Image Experts Group.


JBIG2


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


Undefined


     It is not support compression.


No


     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");