dimtoneff / ComfyUI-PixelArt-Detector

Generate, downscale, change palletes and restore pixel art images with SDXL.
MIT License
174 stars 10 forks source link

Added PixelArtAddDitherPattern node. #12

Closed tsone closed 9 months ago

tsone commented 9 months ago

Didn't hear from you right away so I implemented dithering as well, however through a new PixelArtAddDitherPattern node:

image

The node adds dither pattern to the image RGB values, so any color quantizer after the node achieves a dither look. It's modular and flexible, for example one could use the built-in Quantize node for dithering. The node also adds support for custom dither patterns (via input mask), and the classic 45-degree halftone pattern.

Here's manga'esque halftoning look using built-in Quantize node: Elf_00039_

The amount option is a multiplier for the effect. Generally amount = 1 / num_colors is a good starting point.

Bayer pattern example: ComfyUI_00001_

Blue noise (custom pattern): ComfyUI_00002_

Game Boy Camera'esque look: ComfyUI_00003_

(Blue noise mask image:) blue-noise-16x16

(Workflows included in the images.)

dimtoneff commented 9 months ago

Thanx :) it looks amazing! I will check it out and merge