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.
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.
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.