Documents for Imaging .NET Edition
Features / Apply Effects
In This Topic
    Apply Effects
    In This Topic

    Advanced imaging effects are helpful in a lot of scenarios such as low-color depth environment, image transmission, medical imaging, remote-sensing, acoustic imagery and forensic surveillance imagery.

    GcImaging library offers great flexibility while working with these advanced effects which includes dithering, thresholding, gray scaling and various RGB effects. GcImaging provides the ApplyEffect method in the GcBitmap class which takes the instance of class representing the effect as a parameter. These effects and the corresponding classes are described in detail in the table below. Please note that the ApplyEffect method applies a graphic effect to an image or a portion in-place, which means it stores the result back in the existing Bitmap object instead of storing it in a new instance.

    Original Image BrightnessContrastEffect TemperatureAndTintEffect
    Image of a beautiful house Image of the house after applying brightness and contrast effect Image of the house after applying temperature and tint effect
    Grayscale Thresholding Dithering
    Image of the house after applying grayscale effect Image of the house after applying Thresholding effect Image of the house after applying Dithering effect

    Effects Classes Descriptions
    Dithering DitheringEffect

    Allows you to apply dithering effect through 9 different algorithms which are provided by the DitheringMethod enumeration.

    • Atkinson
    • Burks
    • FloydSteinberg
    • JarvisJudiceNinke
    • Sierra
    • SierraLite
    • Stucki
    • TwoRowSierra
    • NoDithering
    Thresholding

    BradleyThresholdingEffect

    OtsuThresholdingEffect

    Allows you to apply two types of thresholding effects, Bradley's thresholding and Otsu's thresholding, through BradleyThresholdingEffect and OtsuThresholdingEffect class respectively.
    Grayscaling GrayscaleEffect

    Allows you to apply grayscale effect as per the three grayscale standards provided by the GrayscaleStandard enumeration.

    • BT709
    • BT601
    • BT2100
    RGB effects

    OpacityEffect

    HueRotationEffect

    SaturationEffect

    SepiaEffect

    TemperatureAndTintEffect

    LuminanceToAlphaEffect

    BrightnessContrastEffect

    GammaCorrectionEffect

    Allows you to apply various RGB effects using their corresponding classes mentioned in the column on left hand side.

    To apply a graphic effect, say dithering, on an image:

    1. Initialize the GcBitmap class.
    2. Invoke Get method of the DitheringEffect class to define the dithering effect that specifies the method to be used for dithering.
    3. Apply dithering effect to an image using the ApplyEffect method which accepts the defined dithering effect as its parameter.
      C#
      Copy Code
      var imagePath = Path.Combine("Resources", "Images",
                      "color-vegetables-small.jpg");
      
      //Initialize GcBitmap           
      GcBitmap origBmp = new GcBitmap(imagePath,
                         new Rectangle(50, 50, 1024, 1024));
      
      //Apply Dithering effect FloydSteinberg
      origBmp.ApplyEffect(DitheringEffect.Get(DitheringMethod.FloydSteinberg),
                          new Rectangle(0, 0, 1024, 1024));
      
      //Save Dithering effect image
      origBmp.SaveAsJpeg("Dithering.jpg");
      

    Similarly, you can apply any other effect on images as mentioned in the table above.

    Back to Top

    For more information about implementation of different effects using GcImaging, see GcImaging sample browser.