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

How to C#: Sharpness Effects


Overview for Sharpness Effects




Overview



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


Blur


Blur image, simulate a “out of focus” effect.


MotionBlur


Motion blur image with specified blur factor, the angle specifies the angle the object appears to be coming from ,zero degrees is from the right.


Sharpen


Sharpen pixels in image.


Unsharpen


Use a negative scaling to create a mask of the original image, then combined with the original image, creating an image that is less blurry than the original.




Steps to Sharpen Image



Load an image with RasterImage object.


Create an image processor with ImageProcess object.


Call the BlurImage 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 Sharpness Effects



Sample Code (blur image):




RasterImage img = new RasterImage(@"C:\input.tif");
ImageProcess process = new ImageProcess(img);
//blur the image, set radius 0 will give you a suitable radius, and radius should be larger than sigma.  
process.BlurImage(0, 0.5);
//only blur the second page of the input tif.
process.BlurImage(0, 0.5, 1);
img.Save( @"C:\output.tif">);