Skip to content

Quantize

Node icon
Color

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

The Quantize node applied to a source image: original (left) and result (right).
Side-by-side comparison: the original image on the left and the same image after the Quantize node on the right.

Quantize uses k-means clustering to find the best representative colors for the whole image, then remaps every pixel to its nearest match, for a flat look like an indexed-color image. Unlike Posterize, which snaps each channel to evenly spaced levels, it treats each RGB color as a whole, so the palette it picks follows the image.

Wire a palette into the Palette input to snap every pixel to the nearest color in that palette instead (a perceptual match, the same one Dither uses); Colors no longer applies. With nothing wired, k-means picks the colors.

The result is deterministic: the same image and Colors value always reduce to the same colors, so a batch of near-identical frames does not shimmer from frame to frame, and a document looks the same after reopening as when it was saved.

Pins

ImageImage
InputRequired
PalettePalette
InputOptional
ImageImage
Output

Color

ColorsInteger
Default: 16 Range: 2–256

Total number of unique colors in the output. Uses k-means clustering to find the best representative colors for the entire image. Lower = more stylized, higher = more faithful

AttemptsInteger
Default: 3 Range: 1–10

K-means restart attempts. Higher = better color selection but slower. The best result across all attempts is kept

DitherToggle
Default: false

Apply ordered (Bayer 4x4) dithering to reduce visible banding between quantized colors.

Creates a stippled pattern that simulates smoother gradients with fewer colors.

Use PaletteToggle
Default: false

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

  • 8 to 16 colors gives a retro, pixel-art feel.
  • Feed the Palette input from a Palette, Palette From Image, or Palette From Gradient node to remap to an exact set of colors.
  • Quantize’s own Dither is an ordered Bayer pattern. For error diffusion (Floyd-Steinberg, Atkinson) against the same palette, use the Dither node.