Oil painting filter.

Namespace:  AForge.Imaging.Filters
Assembly:  AForge.Imaging (in AForge.Imaging.dll) Version: (


public class OilPainting : BaseUsingCopyPartialFilter


Processing source image the filter changes each pixels' value to the value of pixel with the most frequent intensity within window of the specified size. Going through the window the filters finds which intensity of pixels is the most frequent. Then it updates value of the pixel in the center of the window to the value with the most frequent intensity. The update procedure creates the effect of oil painting.

The filter accepts 8 bpp grayscale images and 24/32 color images for processing.

Sample usage:

// create filter
OilPainting filter = new OilPainting( 15 );
// apply the filter
filter.ApplyInPlace( image );

Initial image:

Result image:

Inheritance Hierarchy


See Also