# Image Quantize

<figure><img src="https://2125629154-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgNjidAB928fLmTnMD3vG%2Fuploads%2FyLvCFS1AhbzOdlv7svN0%2FImageQuantize.jpg?alt=media&#x26;token=d8224334-4e17-4fb9-83ad-b7e9d3b69a2b" alt=""><figcaption></figcaption></figure>

## Documentation

* Class name: `ImageQuantize`
* Category: `image/postprocessing`
* Output node: `False`

The ImageQuantize node is designed to reduce the number of colors in an image to a specified number, optionally applying dithering techniques to maintain visual quality. This process is useful for creating palette-based images or reducing the color complexity for certain applications.

## Input types

<table><thead><tr><th width="148">Field</th><th width="167">Comfy dtype</th><th>Description</th></tr></thead><tbody><tr><td><code>image</code></td><td><code>IMAGE</code></td><td>The input image tensor to be quantized. It affects the node’s execution by being the primary data upon which color reduction is performed.</td></tr><tr><td><code>colors</code></td><td><code>INT</code></td><td>Specifies the number of colors to reduce the image to. It directly influences the quantization process by determining the color palette size.</td></tr><tr><td><code>dither</code></td><td><code>COMBO[STRING]</code></td><td>Determines the dithering technique to be applied during quantization, affecting the visual quality and appearance of the output image.</td></tr></tbody></table>

## Output types

<table><thead><tr><th width="108">Field</th><th width="131">Comfy dtype</th><th>Description</th></tr></thead><tbody><tr><td><code>image</code></td><td><code>IMAGE</code></td><td>The quantized version of the input image, with reduced color complexity and optionally dithered to maintain visual quality.</td></tr></tbody></table>
