---
id: fast-colors.quantizehistogram
title: quantizeHistogram() function
hide_title: true
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[@microsoft/fast-colors](./fast-colors.md) &gt; [quantizeHistogram](./fast-colors.quantizehistogram.md)

## quantizeHistogram() function

The data in the color histogram is reduced down to a small set of colors. It can be useful to create the Histogram manually in cases where one wants to remove or alter the colors in it or to re-use it in order to quantize multiple times with different config settings. Based on the Modified Median Cut Quantization implementation from https://github.com/DanBloomberg/leptonica/blob/master/src/colorquant2.c

<b>Signature:</b>

```typescript
export declare function quantizeHistogram(histogram: Histogram, config?: QuantizeConfig): QuantizedColor[];
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  histogram | [Histogram](./fast-colors.histogram.md) |  |
|  config | [QuantizeConfig](./fast-colors.quantizeconfig.md) |  |

<b>Returns:</b>

[QuantizedColor](./fast-colors.quantizedcolor.md)<!-- -->\[\]
