@microsoft/fast-colors > Histogram > (constructor)
Histogram.(constructor)
Constructs a new instance of the Histogram class
constructor(source: PixelBlob, significantBits?: number, pixelSkipping?: number, isHistogramPixelValid?: ((pixel: number[]) => boolean) | null);
Parameters
| Parameter | Type | Description | 
|---|---|---|
| source | PixelBlob | the source pixel data. | 
| significantBits | number | The memory needed for the histogram increases dramatically if significantBits is increased. It needs a buffer which is 4*2^(3*significantBits) in size. EG: for 5 significant bits the histogram is 128K while for 8 it is 64 megs. | 
| pixelSkipping | number | CPU time increases linearly as pixelSkipping is reduced. | 
| isHistogramPixelValid | ((pixel: number[]) => boolean) | null | isHistogramPixelValid is an optional predicate which can screen out unwanted pixels from the source data. EG: ignoring transparent pixels. |