Assembly: AForge.Imaging (in AForge.Imaging.dll) Version: 2.2.3.0 (2.2.3.0)
Syntax
| C# |
|---|
public class ErrorDiffusionToAdjacentNeighbors : ErrorDiffusionDithering |
Remarks
The class does error diffusion to adjacent neighbor pixels using specified set of coefficients. These coefficients are represented by 2 dimensional jugged array, where first array of coefficients is for right-standing pixels, but the rest of arrays are for bottom-standing pixels. All arrays except the first one should have odd number of coefficients.
Suppose that error diffusion coefficients are represented by the next jugged array:
int[][] coefficients = new int[2][] { new int[1] { 7 }, new int[3] { 3, 5, 1 } };
The above coefficients are used to diffuse error over the next neighbor pixels (* marks current pixel, coefficients are placed to corresponding neighbor pixels):
| * | 7 | | 3 | 5 | 1 | / 16
The filter accepts 8 bpp grayscale images for processing.
Sample usage:
// create filter ErrorDiffusionToAdjacentNeighbors filter = new ErrorDiffusionToAdjacentNeighbors( new int[3][] { new int[2] { 5, 3 }, new int[5] { 2, 4, 5, 4, 2 }, new int[3] { 2, 3, 2 } } ); // apply the filter filter.ApplyInPlace( image );
Inheritance Hierarchy
AForge.Imaging.Filters..::.BaseInPlacePartialFilter
AForge.Imaging.Filters..::.ErrorDiffusionDithering
AForge.Imaging.Filters..::.ErrorDiffusionToAdjacentNeighbors
AForge.Imaging.Filters..::.BurkesDithering
AForge.Imaging.Filters..::.FloydSteinbergDithering
AForge.Imaging.Filters..::.JarvisJudiceNinkeDithering
AForge.Imaging.Filters..::.SierraDithering
AForge.Imaging.Filters..::.StuckiDithering