Skip to main content
Version: 1.x

@microsoft/fast-colors > quantize

quantize() function

The image stored in the source PixelBlob is reduced down to a small set of colors. Based on the Modified Median Cut Quantization implementation from https://github.com/DanBloomberg/leptonica/blob/master/src/colorquant2.c

Signature:
export declare function quantize(source: PixelBlob, config?: QuantizeConfig): QuantizedColor[];

Parameters

ParameterTypeDescription
sourcePixelBlob
configQuantizeConfig
Returns:

QuantizedColor[]