eink_dither library

Classes

EInkImageProcessor
E-ink image processor: quantizes a color image to a fixed palette and applies error-diffusion dithering, returning an img.Image.
EInkPaletteQuantizer
E-ink palette quantizer: maps any color to the nearest color in the given palette. Used with img.ditherImage for error-diffusion dithering to fit photos into the limited ink colors of e-ink displays.

Enums

DitherKernel
The pattern to use for dithering
DitherScanOrder
The order in which pixels are visited by the error-diffusion kernels.
EInkColor
Ink colors supported by e-ink displays.
EInkPalette
E-ink palette types.

Functions

ditherImage(Image image, {Quantizer? quantizer, DitherKernel kernel = DitherKernel.floydSteinberg, bool serpentine = false, DitherScanOrder scanOrder = DitherScanOrder.zigzag, double bayerStrength = 1.0}) → Image
Dither an image to reduce banding patterns when reducing the number of colors. Derived from http://jsbin.com/iXofIji/2/edit
ditherImageBayer(Image image, [Quantizer? quantizer, DitherKernel kernel = DitherKernel.bayer4x4, double strength = 1.0]) → Image
Dither an image using an ordered (Bayer) threshold matrix. Unlike the error-diffusion kernels, the dither pattern is position-based and does not propagate error to neighboring pixels, making it deterministic and fast.
ditherImageBlueNoise(Image image, [Quantizer? quantizer, double strength = 1.0]) → Image
Dither an image using a blue-noise threshold mask. Unlike Bayer matrices, blue noise distributes error in a less structured, visually pleasing high-frequency pattern that avoids the grid artifacts of ordered dithering.
ditherImageOrdered(Image image, Quantizer quantizer, List<List<double>> matrix, double strength) → Image
Shared ordered-dither implementation for both Bayer and blue-noise masks.