XImage.Raster
Features
Tech Specs
How-to C#
Pricing

C# Imaging Library
How to compress images in C#?


Explain Image Compression in C# ASP.NET, WinForms, WPF applications.





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.


How to compress raster images using C#?

  1. Download XImage.Raster C# imaging library
  2. Install C# image library to compress TIFF, BMP, PNG, JPG image file in .NET applications
  3. Step by Step Tutorial










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("sample-raster-image.tif");
ImageProcess process = new ImageProcess(image);
process.TransformCompression(Compression.Fax);
image.Save("sample-raster-image-compressed.tif");


Sample code compression image without compression format:

RasterImage image = new RasterImage("sample-raster-image.tif");
ImageProcess process = new ImageProcess(image);
process.TransformCompression(Compression.No);
image.Save("sample-raster-image-not-compressed.tif");