ImageGear v26.0 - Updated
Use Processing Methods
Developer Guide > How to Work with ... > Image Processing and Cleanup > Use Processing Methods

The classes ImGearProcessing Class and ImGearRasterProcessing Class present a set of methods for modifying an image. You do not need to create an ImGearProcessing Class object to call its methods since all methods are static. Any method takes an image to be processed and some additional parameters necessary for processing the operation. For example, the Rotate Method will be called as follows:

C#

ImGearProcessing.Rotate(Page, ImGearRotationValues.VALUE_90);

Image processing methods are shown below:

Action Group API Reference
Crop - removes part of the image ImGearProcessing.Crop Method
Resize - retains the same image, but either increase the number of pixels (interpolating to determine the color values for the new ones), or reduce the number of pixels ImGearProcessing.Resize Method
Changes the geometry of the image

ImGearProcessing.Flip Method

ImGearProcessing.Rotate Method

Changes the contrast, brightness and/or gamma correction in the image - all these methods have two representations: the second type takes two additional parameters Contrast Mode and Channel Range; the first representation of any method calculates these parameters according the image type and color space.

ImGearRasterProcessing.InvertContrast Method

ImGearRasterProcessing.AdjustContrast Method

ImGearRasterProcessing.StretchContrast Method

ImGearRasterProcessing.EqualizeContrast Method

Creating a thumbnail - an image with the new size is created but source image is not changed ImGearProcessing.CreateThumbnail Method
Checking for grayscale image ImGearRasterProcessing.ImageIsGray Method
Filter methods - these methods are based on the convolution of the image and the filter matrix. Any filter method (except Convolution) has two representations: with and without channel range.

ImGearRasterProcessing.Convolve Method

ImGearRasterProcessing.Sharpen Method

ImGearRasterProcessing.Smooth Method

ImGearRasterProcessing.FilterWithMedian Method

ImGearRasterProcessing.FilterWithUnsharpMask Method

Methods for combining two or more images - these methods have two representation: with and without channel range

ImGearRasterProcessing.Merge Method

ImGearRasterProcessing.Blend Method

ImGearRasterProcessing.BlendWithAlpha Method

Methods for manipulating with image channels and color spaces

ImGearRasterProcessing.ConvertColorSpace Method

ImGearRasterProcessing.ChangeChannelDepths Method

ImGearRasterProcessing.CombineChannels Method

ImGearRasterProcessing.SeparateChannels Method

ImGearRasterProcessing.InsertChannel Method

ImGearRasterProcessing.RemoveChannel Method

ImGearRasterProcessing.CreateChannelCopy Method

ImGearRasterProcessing.UpdateChannelFrom Method

ImGearRasterProcessing.SwapChannels Method

Processing binary and grayscale images by applying erosion and dilation

ImGearRasterProcessing.Dilate Method

ImGearRasterProcessing.Erode Method

ImGearRasterProcessing.Close Method

ImGearRasterProcessing.Open Method

Image enhancement - these methods enhance image detail ImGearRasterProcessing.EnhanceLocal Method
Removes red eye

ImGearPixelProcessorRedEyeRGB.ImGearPixelProcessorRedEyeRGB Constructor

Speckle removal - these methods remove noise from a grayscale or bitonal image

ImGearRasterProcessing.Despeckle Method

ImGearRasterProcessing.GeomDespeckle Method

The C# samples given below illustrate how to work with some Image Processing methods (in the samples, assume that igPage is a valid object of type ImGearPage Class):

Rotate

C#

// Rotate the page to 45 degrees and expand according to the new image
// size. The background will be set to black.
// Create background color object
ImGearPixel igPixelBackground = new ImGearPixel(igPage.DIB.ChannelCount, igPage.DIB.BitsPerChannel);

// Rotate
ImGearProcessing.Rotate(igPage, 45, ImGearRotationModes.EXPAND, igPixelBackground);

Crop

C#

// Cut a quarter of an image from left, top, right and bottom
int cutWidth = igPage.DIB.Width / 4;
int cutHeight = igPage.DIB.Height / 4;

// Crop
ImGearProcessing.Crop(igPage, cutWidth, cutHeight, 2 * cutWidth, 2 * cutHeight);

AdjustContrast

C#

double contrast = 1.2;
double brightness = 64;
double gamma = 1.5;
ImGearRasterProcessing.AdjustContrast((ImGearRasterPage)igPage, contrast, brightness, gamma);

See Also

Advanced Image Processing and Correction

Is this page helpful?
Yes No
Thanks for your feedback.