> For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt.

# 量化图像（ImageQuantize）

<div class="node-meta"><code>ImageQuantize</code><span>image/filters</span><span>角色：图像处理</span><span class="star">★ 常用节点</span></div>

ImageQuantize 节点旨在将图像中的颜色数量减少到指定数目，并可选择应用抖动技术以保持视觉质量。此过程对于创建基于调色板的图像或降低某些应用场景中的颜色复杂度非常有用。

## 参数

| 参数       | 类型         | 默认 / 范围                                     | 说明                     |
| -------- | ---------- | ------------------------------------------- | ---------------------- |
| `image`  | IMAGE · 图像 | —（连线输入）                                     | RGB 图像输入；尺寸不一致会被缩放或裁切。 |
| `colors` | INT        | 1 \~ 256                                    | 量化目标色数，越小色块感越强。        |
| `dither` | COMBO      | none、floyd-steinberg、bayer-2、bayer-4 …共 6 项 | —                      |

## 输出

| 输出    | 类型    | 说明 |
| ----- | ----- | -- |
| IMAGE | IMAGE | 图像 |

## 怎么接

- **上游**：LoadImage / VAEDecode
- **下游**：VAEEncode / SaveImage / 下一个图像节点
- **接线**：接在 LoadImage 或 VAEDecode 之后，处理结果再交给 VAEEncode（重绘）、SaveImage（出图）或下一个图像节点；这类节点可以任意串联成处理流水线。

## 使用案例

属于「图像处理」类节点，向下游提供图像数据。从 `image`、`colors`（256）、`dither`（none、floyd-steinberg、bayer-2、bayer-4 …共 6 项） 开始填就能跑起来。典型接法：`LoadImage` → 本节点 → `VAEEncode`。输出类型是 IMAGE，只能接同类型的输入端口，颜色对不上就是接错了。

## 端口与连线示意

![ImageQuantize 端口与连线示意](/svg/ImageQuantize.svg)

## 同类节点

[Canny边缘检测](/nodes/05/Canny.md) · [ColorTransfer](/nodes/05/ColorTransfer.md) · [图像添加噪声](/nodes/05/ImageAddNoise.md) · [混合图像](/nodes/05/ImageBlend.md) · [模糊图像](/nodes/05/ImageBlur.md) · [锐化图像](/nodes/05/ImageSharpen.md) · [图像形态学](/nodes/05/Morphology.md)
