Shrink an image by removing specified color from its boundaries.

Removes pixels with specified color from image boundaries making the image smaller in size.

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

Sample usage:

// create filter Shrink filter = new Shrink( Color.Black ); // apply the filter Bitmap newImage = filter.Apply( image );

Initial image:

Result image:

Inheritance: BaseTransformationFilter
Example #1
0
        private void SetFilter()
        {
            ImageType = ImageTypes.Rgb24bpp;

            Af.Shrink newFilter = new Af.Shrink();
            newFilter.ColorToRemove = color;
            imageFilter             = newFilter;
        }