Skip to main content
Version: 1.x

@microsoft/fast-colors > PixelBox

PixelBox class

Represents a range of colors in RGB color space.

Signature:
export declare class PixelBox 

Constructors

ConstructorModifiersDescription
(constructor)(globalHistogram, minRed, maxRed, minGreen, maxGreen, minBlue, maxBlue)Constructs a new instance of the PixelBox class

Properties

PropertyModifiersTypeDescription
averageColorColorRGBA64
colorVolumenumber
globalHistogramHistogram
maxBluenumber
maxGreennumber
maxRednumber
minBluenumber
minGreennumber
minRednumber
modifiedMedianCut() => [PixelBox | null, PixelBox | null]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
pixelCountnumber
rangeBluenumber
rangeGreennumber
rangeRednumber