Assembly: AForge.Imaging (in AForge.Imaging.dll) Version: 188.8.131.52 (184.108.40.206)
public class MaskedFilter : BaseInPlacePartialFilter
The image processing routine applies the specified BaseFilter to a source image according to the specified mask - if a pixel/value in the specified mask image/array is set to 0, then the original pixel's value is kept; otherwise the pixel is filtered using the specified base filter.
Mask can be specified as .NET's managed Bitmap, as UnmanagedImage or as byte array. In the case if mask is specified as image, it must be 8 bpp grayscale image. In all case mask size must be the same as size of the image to process.
// create the filter MaskedFilter maskedFilter = new MaskedFilter( new Sepia( ), maskImage ); // apply the filter maskedFilter.ApplyInPlace( image );