Skip to main content

@microsoft/fast-colors > PixelBox > modifiedMedianCut

PixelBox.modifiedMedianCut property

Attempts to divide the range of colors represented by this PixelBox into two smaller PixelBox objects. This does not actually cut directly at the median, rather it finds the median then cuts halfway through the larger box on either side of that median. The result is that small areas of color are better represented in the final output. Based on the Modified Median Cut Quantization implementation from https://github.com/DanBloomberg/leptonica/blob/master/src/colorquant2.c

Signature:
modifiedMedianCut: () => [PixelBox | null, PixelBox | null];