Extract RGB channel from image.

Extracts specified channel of color image and returns it as grayscale image.

The filter accepts 24, 32, 48 and 64 bpp color images and produces 8 (if source is 24 or 32 bpp image) or 16 (if source is 48 or 64 bpp image) bpp grayscale image.

Sample usage:

// create filter ExtractChannel filter = new ExtractChannel( RGB.G ); // apply the filter Bitmap channelImage = filter.Apply( image );

Initial image:

Result image:

Inheritance: BaseFilter
Example #1
0
 private void SetFilter()
 {
     ImageType = ImageTypes.Rgb32bpp;
     if ((int)mode > 3)
     {
         Af.YCbCrExtractChannel newFilter = new Af.YCbCrExtractChannel();
         newFilter.Channel = (short)(mode - 4);
         imageFilter       = newFilter;
     }
     else
     {
         Af.ExtractChannel newFilter = new Af.ExtractChannel();
         newFilter.Channel = (short)mode;
         imageFilter       = newFilter;
     }
 }