Assembly: AForge.Imaging (in AForge.Imaging.dll) Version: 220.127.116.11 (18.104.22.168)
public abstract class ErrorDiffusionDithering : BaseInPlacePartialFilter
The class is the base class for binarization algorithms based on error diffusion.
Binarization with error diffusion in its idea is similar to binarization based on thresholding of pixels' cumulative value (see ThresholdWithCarry). Each pixel is binarized based not only on its own value, but on values of some surrounding pixels. During pixel's binarization, its binarization error is distributed (diffused) to some neighbor pixels with some coefficients. This error diffusion updates neighbor pixels changing their values, what affects their upcoming binarization. Error diffuses only on unprocessed yet neighbor pixels, which are right and bottom pixels usually (in the case if image processing is done from upper left corner to bottom right corner). Binarization error equals to processing pixel value, if it is below threshold value, or pixel value minus 255 otherwise.
The filter accepts 8 bpp grayscale images for processing.