XImage.Raster
Features
Tech Specs
How-to C#
Pricing

C# Imaging Library
How to C#: Color and Lightness Effects


Overview for Color and Lightness Effects





By using the XImage.Raster SDK, you can get and modify the color and lightness effects of image by assigning to processor. The related properties are as follows.
  • Binarize It may be useful to convert an image to 1bpp for facilitate cleanup image or image recognition. By setting the BinarizeThreshold property whose value range is 0 to 255, it will permanently modify the image to 1bpp grayscale image of the same dimensions. While, the BinarizeLceFactor property will control the image's contrast.
  • Negate Negate colors in image, if you only want to negate grayscale values in the image, then pass value true to NegateImage method.
  • Solorize Simulate the scene of exposing a photographic film to light during the development process. The colors above threshold value will be negated.
  • Posterize The images' colors will be reduced to simulate a "poster" effect.
  • Emboss Convert the image to grayscale with a three-dimensional effect.


Steps to Posterize Image



  • Load an image with RasterImage object.
  • Create an image processor with ImageProcess object.
  • Call the PosterizeImage method of ImageProcess object to complete the task flopping image.
  • Save the modified image to an image file on the disk.


Posterize Image



Sample Code (posterize image):

RasterImage img = new RasterImage(@"C:\input.tif");
ImageProcess process = new ImageProcess(img);
//simulate a poster effect, the number of color levels in each channel is set to 4. 
process.PosterizeImage(4, false);
//only posterize the second page of the input tif.
process.PosterizeImage(4, false, 1);
img.Save(@"C:\output.tif">);