Pixelate Effect (Purz)
The pixelate node that's secretly a retro game pipeline
- image
- mask
- image
Most "pixelate" nodes shrink your image into chunky squares and call it a day. PurzPixelate isn't one of them. Since the v2.0 rewrite it's a real retro-graphics pipeline: it downsamples, snaps colors to a Game Boy or NES palette, dithers away the banding, and redraws the grid lines - then hands you a normal IMAGE you can feed straight back into img2img, use as a texture, or drop into a video frame batch. You reach for it when you want pixel-art vibes, not just blocks.
It comes from purzbeats' ComfyUI-Purz pack, a personal utility drawer that also ships patterns and video tools. It's pure Python and NumPy under the hood - no model files, no API, nothing to download beyond the node itself.
How it works
Think of it as a four-stage mini-pipeline. First it downsamples your image into a low-res grid, one "pixel" per block. Then it quantizes colors, either to num_colors evenly-spaced posterize levels or to a named retro palette. Then, optionally, it dithers - ordered Bayer thresholds or full Floyd-Steinberg error diffusion - so those few colors don't band. Finally it nearest-neighbor-upscales back to your original resolution and, if you ask, draws the grid lines over the seams.
The palettes are the fun part and they're real, hardcoded color sets: Game Boy, NES, C64, PICO-8, CGA, and Endesga 32. Pick pico8 and a photo suddenly reads as a tiny game sprite.
The inputs that matter
- image - the
IMAGEyou're pixelating. Works on a batch. - pixel_size - block size in pixels, 2–128, default 8. The main dial.
- pixel_size_y - set this to 0 (default) for square pixels, or a different value for that stretched non-square retro look.
- palette_mode -
none,posterize, or one of the six retro palettes. - num_colors - only used when
palette_modeisposterize. Palette modes ignore it. - dithering -
ordered_2x2/4x4/8x8(fast, pattern-y) orfloyd_steinberg(smoother, slower).dither_strength0–2 tunes it. - grid_lines - 0 to 0.5; the width of the seam lines as a fraction of pixel size.
grid_colorpicks black, dark gray, or white. - output_mode -
upscaled(back to full size) orlow_res(keep the tiny grid, useful if you're resampling yourself). - mask (optional) - blend pixelation in only where the mask is white.
Output is a single image (IMAGE), ready for a VAE encode, a Save Image node, or a video combiner.
Install
Same story as the rest of the pack: ComfyUI Manager (search "ComfyUI-Purz"), or
cd ComfyUI/custom_nodes
git clone https://github.com/purzbeats/ComfyUI-Purz.git
cd ComfyUI-Purz
pip install -r requirements.txt
then restart ComfyUI. The only real dependencies are OpenCV, Pillow, NumPy, and torch - all things you almost certainly already have.
Where people get burned
- Mask only blends in
upscaledmode. If you setoutput_modetolow_reswith a mask attached, the mask is silently ignored - the code only composites it on the upscaled path. - Floyd-Steinberg is slow on big images. It's a per-pixel error-diffusion loop; a 1080p photo takes a noticeable beat. Reach for
ordered_4x4first, or downscale before you pixelate. num_colorsdoes nothing in palette mode. If you set a palette and wonder why the color count slider isn't doing anything - that's why. It only drivesposterize.- Posterize with too few levels looks flat fast. Default 8 is a decent start; 16 reads less crunchy.
If it's a one-off, the default area downsample + pico8 + ordered_4x4 dither is a great first look. After that, poke the palettes - that's where the node earns its keep.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| pixel_size | INT | 82–128 | — |
| pixel_size_y | INT | 00–128 | — |
| downsample | COMBO | area | 3 options: area, nearest, median |
| palette_mode | COMBO | none | 8 options: none, posterize, game_boy, nes, c64, pico8, +2 |
| num_colors | INT | 82–256 | — |
| dithering | COMBO | none | 5 options: none, ordered_2x2, ordered_4x4, ordered_8x8, floyd_steinberg |
| dither_strength | FLOAT | 1.000–2 | — |
| grid_lines | FLOAT | 0.000–0.5 | — |
| grid_color | COMBO | black | 3 options: black, dark_gray, white |
| output_mode | COMBO | upscaled | 2 options: upscaled, low_res |
| maskopt | MASK | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |