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

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

## 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

<b>Signature:</b>

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

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  source | [PixelBlob](./fast-colors.pixelblob.md) |  |
|  config | [QuantizeConfig](./fast-colors.quantizeconfig.md) |  |

<b>Returns:</b>

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