Skip to content

Quantize

Node icon
Color

Reduces the image to N total colors using k-means clustering for whole-image palette reduction.

Quantize reduces the entire image to a specified number of unique colors. It uses k-means to find the best representative colors, then remaps every pixel to its nearest match. This creates a flat, stylized look similar to indexed-color images.

Unlike Posterize (which operates per-channel), Quantize considers the full RGB color together, producing a more harmonious and intentional palette.

Connect the optional Palette input to snap each pixel to the nearest color in a wired palette using a perceptual match, the same way Dither does. With no palette connected, the k-means behavior is unchanged and the color count controls the result.

Pins

ImageImage
InputRequired
PalettePalette
InputOptional
ImageImage
Output

Color

ColorsInteger
Default: 16 Range: 2–256

Number of unique colors in the output (k-means clustering)

AttemptsInteger
Default: 3 Range: 1–10

K-means restart attempts; higher = better but slower

DitherToggle
Default: false

Apply Bayer 4x4 dithering to reduce banding

Use PaletteToggle
Default: false

Auto-enabled when a Palette is connected (drives the color set)

  • Enable dithering to reduce visible banding and color transitions.
  • Use 8–16 colors for a retro/pixel art style.
  • Connect a Palette (from a Palette, Palette From Image, or Palette From Gradient node) to remap to an exact set of colors instead of letting k-means pick them.
  • For a dithered version of the same palette snap, use the Dither node, which spreads quantization error for smoother gradients.