[][src]Module pbnify::quantize

Extensions for quantization and dithering of images to reduce the number of unique colors.

Functions

build_palette

Performs the median-cut algorithm, producing an n-color palette based on the given set of pixels.

quantize

Substitutes each pixel in the given image with its closest approximation in the given palette. This method also employs Floyd-Steinberg dithering to smooth out gradients and more accurately represent colors which do not have close approximations in the given palette.