Studio Yotsuba
Back to Node List

Dither

dither

Quantizes to a palette with ordered, image-pattern, or error-diffusion dithering; palette order can be preserved as a shading ramp.

Reviewed
Guide available

Input Ports

NameTypeDescription
Image
input
Image
Required
Image to dither
Palette
palette
Palette
Optional palette. If omitted, a palette is extracted from the image
Pattern Image
threshold_map
Image
Optional grayscale pattern tiled across the output in Pattern Image mode. Bright pixels push toward the next palette color; dark pixels hold the previous color.

Output Ports

NameTypeDescription
Image
output
Image
Dithered image
Palette
palette
Palette
Palette used for dithering

Parameters

NameTypeDefaultRangeDescription / Options
Mode
mode
Enum
Ordered4x4—

Dithering algorithm

  • Ordered4x4Ordered4x4
    Uses a 4x4 Bayer matrix for deterministic ordered dithering.
  • FloydSteinbergFloydSteinberg
    Uses Floyd-Steinberg error diffusion dithering.
  • PatternImagePatternImage
    Tiles the connected Pattern Image as a custom threshold pattern. Use Pixel Canvas, noise, or procedural patterns to design the dots.
Color Choice
color_choice
Enum
NearestColor—

Use closest-color reduction for general images, or preserve palette slot order for controlled material and character shading ramps.

  • NearestColorNearestColor
    Choose the closest palette color after applying the dither. This is the existing behavior and works for ordinary full-color reduction.
  • PaletteOrderPaletteOrder
    Treat the connected palette as an ordered ramp and mix only neighboring slots. Use this for shadow-to-highlight ramps whose order must not change.
Ramp Source
ramp_source
Enum
OKLCH-L—

Which input value moves from the first palette slot to the last. OKLCH lightness is the usual choice for shadow ramps; Alpha is useful for mask ramps.

  • OKLCH-LOKLCH-L
    Use perceived brightness. Good when you want the result to match how bright it looks.
  • OKLCH-COKLCH-C
    Use how colorful the pixel is.
  • HSV-SHSV-S
    Use HSV saturation.
  • HSV-VHSV-V
    Use HSV value.
  • RGB-RRGB-R
    Use the red channel.
  • RGB-GRGB-G
    Use the green channel.
  • RGB-BRGB-B
    Use the blue channel.
  • AlphaAlpha
    Use alpha.
  • LuminanceLuminance
    Use Rec.709 RGB luminance.
Extract Mode
extract_mode
Enum
Representative—

How to derive a palette when no palette input is connected

  • ExactExact
  • RepresentativeRepresentative
Max Colors
max_colors
Int
161–256

Maximum number of colors to keep

Include Transparent in Palette
include_transparent
Bool
false—

Include fully transparent pixels when extracting a palette

Process Transparent Pixels
process_transparent_pixels
Bool
false—

Also quantize the hidden RGB of fully transparent pixels

Preserve Alpha
preserve_alpha
Bool
true—

Keep the original alpha channel after dithering

Strength
strength
Float
10–2 / step 0.01

How strongly the dithering pattern affects the result

Overview

Quantizes to a palette while applying a dither pattern that represents intermediate tones with few colors. It is essential for reducing gradients to a 2–16-color texture that reads as retro pixel art.

Usage tips

  • Choose the method by look: orderly checkerboard retro texture → Ordered4x4; natural photographic grain → FloydSteinberg; hand-drawn dots, crosshatching, or wood grain → PatternImage. Ordered and Pattern Image often feel more deliberately placed.
  • In PatternImage, connect a small grayscale image to threshold_map. It tiles across the output: bright pattern pixels advance to the next palette color, while dark pixels hold the previous color. Start with a 4–16 px Pixel Canvas and strength 0.3–0.7.
  • Use NearestColor for general full-color reduction. Use PaletteOrder when the slots deliberately run shadow → midtone → base → highlight. It mixes only adjacent slots, preventing color distance from jumping over a designed shading stage.
  • Palette Order requires a connected palette with at least two colors. For ramp_source, start with OKLCH lightness for shading, RGB-R or luminance for a 0–1 control image, and Alpha for an opacity ramp.
  • Connecting a palette is the standard setup. Connect the project palette to keep the asset within the overall color system. When unconnected, colors are extracted automatically from the image, with the count controlled by max_colors.
  • strength controls the visibility of the pattern in both modes. 1 is standard; 0.3–0.7 gives a subtle pattern, 2 creates a strongly gritty texture, and 0 performs palette quantization without adding ordered offsets or diffusing quantization error.
  • include_transparent affects automatic palette extraction only. process_transparent_pixels separately controls whether hidden RGB in fully transparent pixels is quantized. Both should normally stay OFF.
  • Gradient → dither with a 2–4-color palette quickly creates retro skies, glows, and water.

Common pitfalls

  • No pattern appears: dithering has no effect when the input has no intermediate tones and already matches the palette exactly. Use it on continuous-tone gradients or noise.
  • No pattern appears after Gradient Map(Steps): Steps already discarded the fractional position between palette slots. Feed the continuous source directly to Dither and select PaletteOrder when those intermediate tones should become dots.
  • Pattern Image still looks like 4×4 ordered dots: threshold_map is unconnected. The node safely falls back to Ordered 4×4 and shows a warning until a pattern arrives.
  • Palette Order behaves like closest color: connect an intentionally ordered palette containing at least two colors. Auto-extracted colors have no user-defined slot order, so the node warns and falls back to closest color.
  • Colors look muddy or unexpected colors appear: automatic extraction with Representative creates average representative colors. Connect a palette or use extract_mode = Exact when only specified colors are allowed.
  • Transparent areas look wrong: preserve_alpha (ON by default) retains source transparency. Enable include_transparent only to include transparent colors in an extracted palette, and enable process_transparent_pixels only when their hidden RGB should also be modified.

Notes

  • 誤差拡散 tends to preserve local contrast; 順序 4x4 is regular and easy to control.
  • Pattern Image reads RGB luminance and ignores pattern alpha. Use invert upstream when the spatial pattern should be reversed.
  • Palette Order preserves the adjacent-slot restriction in Ordered 4×4, Pattern Image, and error-diffusion modes.
  • When a palette input is connected, that palette is used as-is.
  • _count is the number of palette colors actually used.

Examples

  1. Reduce to the color count produced by Palette Extract.
  2. Create a retro screen pattern with a two-color black-and-white palette.
  3. Produce a more visibly patterned quantization than Palette Quantize.
  4. Draw an 8×8 wood hatch in Pixel Canvas, then combine PatternImage + PaletteOrder so only neighboring colors in the wood ramp alternate.

Related nodes

  • palette_quantize — simple quantization without dithering for flat results
  • palette_extract — extract the quantization palette from an image
  • gradient_generate / noise_generate — create continuous tones that show dithering well
  • posterize — reduce tonal steps by count rather than by palette
  • gradient_map — create flat palette bands; feed continuous values directly here for palette-order dithering
Back to Node List