Pixydust Quantizer is a custom node extension for ComfyUI that allows for the simplified recreation of tile patterns used in 1990s 16-color PC graphics, offering advanced color quantization and palette optimization features.
- Original
- Pixydust Quantizer
- Regular tool (ImageQuantize)
- Simplified recreation of tile patterns used in 1990s 16-color PC graphics
- Prioritizes colors used in large areas of the image (e.g., a character's face) for the palette, preventing unnecessary tile patterning
- Threshold settings to adjust the balance between tile patterns and flat colors
- External palette input function to maintain palette consistency in videos or image sequences
- Control over which colors are tile-patterned, which was difficult with traditional methods
The name "Pixydust" combines "pixy" (as in pixel art) and "dust" (to suggest a grainy look), with an added nuance of a clever, tricky effect, like the magic of fairy dust.
-
Navigate to the custom node directory in ComfyUI:
cd ComfyUI/custom_nodes/
-
Clone this repository:
git clone https://github.com/yourusername/ComfyUI-Pixydust-Quantizer.git
-
Install the required dependencies:
pip install -r ComfyUI-Pixydust-Quantizer/requirements.txt
-
Restart ComfyUI
This node reduces the colors of an input image using the specified method and maximum number of colors.
Inputs:
image
: Input imagecolor_reduction_method
: Choose from "Pillow Quantize", "K-Means", or "MedianCut"max_colors
: Maximum number of colors after reduction
Outputs:
Reduced Color Image
: Image with reduced colorsPalette Preview
: Preview of the color palette usedPalette Tensor
: Color palette in tensor format
This node optimizes the palette of a color-reduced image and applies dithering. It assigns palette colors based on the proportion of each color used in the image to avoid tile patterning in prominent areas like a character’s face.
Inputs:
reduced_image
: Input image with reduced colorsfixed_colors
: Number of colors in the optimized palettereduction_method
: Choose from "K-Means" or "MedianCut"dither_pattern
: Choose from "None", "2x2 Bayer", "4x4 Bayer", or "8x8 Bayer"color_distance_threshold
: Threshold for using tile patternspalette_tensor
(optional): External palette input for videos
Outputs:
Optimized Image
: Image with optimized palette and dithering appliedColor Histogram
: Color histogram of the optimized imageFixed Palette
: Optimized color palette in tensor format
Here’s a simple workflow example:
- Load an image
- Connect the image to the Pixydust Quantize-1
- Connect the output of the ColorReducerNode to the Pixydust Quantize-2
- Save or display the resulting optimized image
Note: The processing speed isn't very fast so far. It takes about 10 seconds (depending on the machine's power) to generate a 512x512 pixel image.
This project is licensed under the MIT License - see the LICENSE file for details.
- Special thanks to the ComfyUI community for providing the tools and creative motivation!