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

How to C#: Special Effects


Overview for Special Effects



Related .net document control helps:
asp.net excel file viewer: ASP.NET Excel Document Viewer in C# Control: view office excel files online in ASP.NET web applications
asp.net pdf viewer control: ASP.NET PDF Viewer Control: view, navigate, zoom Adobe PDF document in C# ASP.NET
file redact asp.net: Redact document ASP.NET: add, delete, apply redaction on PDF files in web browser using C#.net
view document asp.net: View multiple document formats in ASP.NET, MVC, Ajax, Azure using C# control
asp.net office document viewer: ASP.NET Office Word Document Viewer: view MS Office Word files online using C# in ASP.NET web applications
asp.net edit pdf image control: ASP.NET PDF Image Edit Control: online insert, edit PDF images in C#
asp.net edit pdf text control: ASP.NET PDF Text Edit Control: online edit PDF text content using C# ASP.NET


Overview



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


AddNoise


Add specific type(NosiType enumeration) noise to the image.


Buttonize


Lighten or darken the edge of the image to simulate a 3D button effect.


CandyEdge


Detect a wide range of edges in the image.


CharcoalSkectch


Stimulate a charcoal sketch.


Clamp


If the pixel value is below zero, then set it to zero, if the pixel value above quantum range(e.g. 65535 or 255), then set it to quantum range.


Crop


Get the specific sub-region of the original image


Distort


Distort the image with a variety of distort methods, such as Perspective ,Bilinear, barrel and so on.


Compare


Compare two images.


Decipher


Decipher the image with specified pass phrase.


Edge


Highlight the image edge.


Enhance


A digital filter will be applied to the noisy image to improve it’s quality.


Erase


Set the image to current background color, the background color can be set by:ImageProcess.BackgroundColor = Color.Red.


Encipher


Encipher the image with specified pass phrase.


Effect3D


Stereo image. you should have two images: left.png and right.png.


Firstly, call SepareteImageChannel(ChannelType.Red) to get a grayscale image which extract form the left.png image's red channel. Then call SepareteImageChannel(ChannelType.Blue) to get a grayscale image which extract form the right.png image's blue channel. Next, call this method. At last, View the result with red-blue glasses.


Frame


Surround the image with a three-dimensional border.


HoughLine


Use with CannyEdgeImage method to identify lines in the image.


Implode


Implode image pixel with the specified percentage.


Kuwahara


An edge preserving filter will be applied to the image to reduce the noise.


LinearStretch


Level the pixel between the black point and white point.


Magnify


Double the image size.


Mignify


Half the image size.


Normolize


Get the darkest pixel value and map 2% of it to all the pixels, get the brightest pixel value and map 1% of it to all the pixels.


OilPaint


A filter will be applied to the image to simulate a oil painting effect.


PencilSketch


Simulates a pencil sketch


ReduceNoise


Use the peak elimination filter to reduce the image noise.


Swirl


Rotate image pixel with the specified angle.


Texture


Repeatedly tiles the image(texture) on the original image background.


Wave


Shift the image pixel along a sin wave to simulate a wave effect.




Steps to Modify Image Special Effects



Load an image with RasterImage object.


Create an image processor with ImageProcess object.


Call the responding 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.




Modify Image Special Effects



Sample Code (Image Effect3D):




RasterImage leftImage = new RasterImage(@"F:\Source1.png");
RasterImage rightImage = new RasterImage(@"F:\Source2.png");
ImageProcess processLeft = new ImageProcess(leftImage);
ImageProcess processRight = new ImageProcess(rightImage);
//get red channel of the image and returned it as a grayscale image
processLeft.GetImageChannel(ChannelType.RedChannel);
//get blue channel of the image and returned it as a grayscale image
processRight.GetImageChannel(ChannelType.BlueChannel);
processLeft.Effect3D(rightImage);
leftImage.Save(@"F:\Output.png");