Rotate image using nearest neighbor algorithm.

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


public class RotateNearestNeighbor : BaseRotateFilter


The class implements image rotation filter using nearest neighbor algorithm, which does not assume any interpolation.

Note:Rotation is performed in counterclockwise direction.

The filter accepts 8/16 bpp grayscale images and 24/48 bpp color image for processing.

Sample usage:

// create filter - rotate for 30 degrees keeping original image size
RotateNearestNeighbor filter = new RotateNearestNeighbor( 30, true );
// apply the filter
Bitmap newImage = filter.Apply( image );

Initial image:

Result image:

Inheritance Hierarchy

See Also