Guide for C#
Core Document Formats
Additional Features

C# Imaging - Image Compression & Decompression

Visual C# Codes for Encoding, Decoding Document & Image for .NET Program

Visual C#
Home > .NET Imaging SDK > C# > Compress Image
If this is your first time to use our DocImageSDK, we strongly suggest you reading How to Start first!

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.
In this image codec page, users will get as much as images compression and decompression guide:
  • Images and documents encoding and decoding benefits, algorithms and technologies in Visual C# imaging program
  • How to: setup C# Windows imaging application to implement .NET imaging encoding and decoding control
  • How to: stable and flexible C#.NET images and documents compression and decompression method solutions
  • How to: complete images and documents compressing and decompressing demo code in C#
  • Some basic knowledge on images lossy and lossless compression based on international image compression standard
C# Image Encoding and Decoding Features & Technique Requisites
  • Images and documents encoding and decoding algorithms and techniques from standard based .NET Imaging SDK
  • Imaging compression library is easy to be integrated in Visual C# project
  • Support compressing and decompressing multiple image color modes, such as bitonal, monochrome, grayscale, and more
  • Complete images lossy and lossless compression options are available in C# class
  • .NET Imaging Saving methods for storing compressed images to memory to reduce system storing space
C# Image Compression and Decompression
In this part, you will get known on how to setup a Windows project in Visual C# imaging class to compress and decompress images and documents.
  1. Download and install C#.NET Image SDK evaluation package to you computer;
  2. Create a Visual C#.NET imaging project in Visual Studio 2005, 2008 or 2010;
  3. Copy created RasterEdge developer license file to the new C# project folder;
  4. Correctly embed compliant project references of RasterEdge .NET Imaging SDK DLLs;
  5. Add and run following using statements of .NET Imaging Compressing Libraries:
using System.IO;
using System.Drawing.Printing;
using RasterEdge.Imaging;
using RasterEdge.Imaging.Codec;
C# Image Compression and Decompression Methods
RasterEdge .NET Imaging SDK provides developers mature methods to compress and decompress documents and images in C#.NET applications.
private void ImageCompression(string inFile, string outFile, ImageEncoder encoder);
private void ImageDecompression(string inFile, string outFile, ImageDecoder Decoder);
C# Image Compressing and Decompressing Sample Code
Please refer to the respective images compressing and decompressing sample code that managed in full C# class.

C# Image Compression Demo Code

Below is the entire C# demo code to compress images in your C#.NET project. As for the complete supported image compressing formats, please go to: list of image compression formats in C#.NET platform.
using System.IO;
using System.Drawing.Printing;
using RasterEdge.Imaging;
using RasterEdge.Imaging.Codec.Compression;

ImageEncoder = ImageEncoder.Group3Encoding

RasterEdgeImaging Image = new RasterEdgeImaging();
Image.ImageCompression(@"C:\1.tif", "C:\2.tif", ImageEncoder ImageEncoder.Group3Encoding);

C# Image Decompression Demo Code

Below is the entire C# demo code to decompress images in your C#.NET project.
using System.IO;
using System.Drawing.Printing;
using RasterEdge.Imaging;
using RasterEdge.Imaging.Codec.Decompression;

ImageDecoder = ImageDecoder.Group3Decoding

RasterEdgeImaging Image = new RasterEdgeImaging();
Image.ImageDecompression(@"C:\1.tif", "C:\2.tif", ImageDecoder ImageDecoder.Group3Decoding);
Basic Knowledge on Image Lossy and Lossless Compression
As we know, we compress images and documents for reducing the needless and redundancy of the image page data in order to store or transmit images in an efficient size. Images compression includes lossy and lossless solutions. Choice of lossy or lossless compression depends on the image forms and your purposes.
Lossy compressing method is widely used when images are like photographs and images bit reduction is acceptable. While lossless compression solution is preferred in some official fields, such as for medical imaging, technical drawings or comics. Whether you adopt losssy or lossless compression method, you can get the high fidelity images at last.
If you are using VB.NET programming language, please directly refer to image compression & decompression in VB.NET. Also, we provide online tutorials for image compressing decompressing in .NET WinForms and ASP.NET Web Froms applications, please see image compression & decompression in WinForms and web document.

Recommend this to Google+