Nodes/ComfyUI PixelArt Detector/📺PixelArt Add Dither Pattern
ComfyUI Node

📺PixelArt Add Dither Pattern

The dither node for faking shades the palette can't express

By dimtoneff·Created 3 years ago·Updated 10 months ago· 429
📺PixelArt Add Dither Pattern
  • image
  • custom_pattern
  • IMAGE
pattern_typebayer
pattern_order3
amount0.2500

Dithering is how pixel art fakes a gradient it doesn't have the colors for: instead of a smooth fade, you scatter the two nearest colors in a checkerboard and let the eye blend them. Old consoles did this because they had to; you can do it because it looks good. This node is the pack's dedicated dither pass - a 2024 addition by contributor @tsone - and it's simpler than the Converter's dithering options in one useful way: it just stamps a pattern onto your image and hands it back, so you can layer it on top of anything.

How it works

The mechanism is refreshingly direct. It builds a small pattern matrix - a Bayer matrix at a given order, or a 45° halftone dot pattern - scales it by your amount, tiles it across the image, and adds it: image + pattern, clamped to 0–1. Pixels under the pattern's peaks get nudged toward white, the rest stay put, and you get a fine texture of lightened pixels that reads as an in-between shade. That's ordered dithering in the classic sense.

Crucially, this is not error-diffusion (Floyd–Steinberg). It won't adapt to your image or cleanly map it onto a target palette - it just lays a texture on top. If your goal is "convert to 4-color Game Boy with proper dithering," the Converter's dither option does the full job. Reach for this node when you want a dither texture on an image that's already been reduced - or when you want the same pattern on anything, including non-pixel-art output.

The inputs that matter

  • pattern_type - bayer (ordered checkerboard, the classic), halftone (45° dot screen, the comic-print look), or none (a zero pattern - pointless unless you're testing).
  • pattern_order - 1–5, default 3. Higher order = finer/softer pattern. Order 1 is chunky and aggressive; 4–5 gets subtle.
  • amount - 0–1, default 0.25. How strongly the pattern is applied. 0.25 is a light texture; pushing toward 1 makes it look like a printed halftone.
  • custom_pattern (optional) - a MASK input that replaces the built-in patterns with your own, normalized before use. This is the power feature: feed any pattern you want as a mask and it gets tiled the same way.

Output is a single IMAGE - the dithered image, ready to preview, save, or feed onward.

Where it fits

Classic chain: PixelArt Detector (Image->) → Palette Converter → PixelArt Add Dither Pattern → Save. Reduce to a tiny palette first, then add a light bayer pattern to break up the banding between shades. The order matters: dithering a full-color image just adds noise; dithering after quantization adds the retro texture.

Installing the pack

This node ships in dimtoneff/ComfyUI-PixelArt-Detector. Install via ComfyUI Manager (search "ComfyUI PixelArt Detector") or:

cd ComfyUI/custom_nodes
git clone https://github.com/dimtoneff/ComfyUI-PixelArt-Detector

Restart ComfyUI. The pack auto-installs its dependencies on first load (opencv-python, scipy, pyclustering, Pillow, numpy). pyclustering comes from a prebuilt wheel the author hosts (x86_64 only); on Apple Silicon or unusual Python versions, install it manually and restart.

Gotchas

  • It doesn't reduce colors. It adds texture only. Apply it after palette reduction, not instead of it.
  • pattern_order doesn't change the pattern size in the intuitive direction you might expect - higher order produces a denser, finer matrix. Crank it and squint before assuming it's broken.
  • This node can't see your palette, so it can't guarantee the lightened pixels stay "in palette." After a strong dither, you may want a final pass through the Converter to snap the result back to the palette - a two-step trick that genuinely looks great.
  • Old node instances embedded in downloaded workflows don't update in place - delete and re-add from the Image/PixelArt menu.
Categoryimage/PixelArt🕹️

Inputs (5)

NameTypeDefaultDescription
imageIMAGE
pattern_typeCOMBObayer3 options: bayer, halftone, none
pattern_orderINT31–5
amountFLOAT0.25000–1
custom_patternoptMASK

Outputs (1)

NameTypeDescription
IMAGEIMAGE