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

How to C#: Blending Effects


Overview for Blending Effects




Overview



By using the XImage.Raster SDK, you can get and modify the blending effects of image by assigning to processor. The related properties are as follows.


Spread


Displace the image pixel randomly by the specified amount


Median


A filter will be applied to the image, the pixel is replaced with the median color in a circular neighborhood. The radius of the circle is under your control.




Steps to Modify Blending Effects



Load an image with RasterImage object.


Create an image processor with ImageProcess object.


Call the SpreadImage method of ImageProcess object to complete the task flopping image.


Save the modified image to an image file on the disk.


In order to acheive the work, please refer to the following steps.




Install XImage.Raster in C# Project



Add necessary references to your C#.NET project. Right-click the project and select "Add Reference..." to locate and add the following DLLs as project references;


  RasterEdge.Imaging.Basic.dll


  RasterEdge.XImage.Raster.Core.dll


  RasterEdge.XImage.Raster.dll


Use corresponding namespaces;


  using RasterEdge.XImage.Raster;


Note: When you get the error "Could not load file or assembly 'RasterEdge.Imaging.Basic' or any other assembly or one of its dependencies. An attempt to load a program with an incorrect format", please check your configure as follows:

       

       If you are using x64 libraries/dlls, Right click the project -> Properties -> Build -> Platform target: x64.

       

       If using x86, the platform target should be x86.




How to Modify Blending Effects



Sample Code (spread image):




RasterImage img = new RasterImage(@"input.tif");
// This code demonstrates how to create a new processor
ImageProcess processor = new ImageProcess(img);
//spread all pages
processor.SpreadImage(200);
//spread the second page
processor.SpreadImage(200, 1);
img.Save(@"output.tif">);




Sample Code (median image):




RasterImage img = new RasterImage(@"input.tif");
// This code demonstrates how to create a new processor
ImageProcess processor = new ImageProcess(img);
//median all pages
processor.MedianFilter(200);
//median the second page
processor.MedianFilter(200, 1);
img.Save(@"output.tif">);