The filter implements convolution operator, which calculates each pixel of the result image as weighted sum of the correspond pixel and its neighbors in the source image. The weights are set by
Convolution is a simple mathematical operation which is fundamental to many common image processing filters. Depending on the type of provided kernel, the filter may produce different results, like blur image, sharpen it, find edges, etc.
The filter accepts 8 and 16 bpp grayscale images and 24, 32, 48 and 64 bpp color images for processing. Note: depending on the value of ProcessAlpha property, the alpha channel is either copied as is or processed with the kernel.
Sample usage:
// define emboss kernel int[,] kernel = { { -2, -1, 0 }, { -1, 1, 1 }, { 0, 1, 2 } }; // create filter Convolution filter = new Convolution( kernel ); // apply the filter filter.ApplyInPlace( image );
Initial image:
Result image: