Visit ComfyUI Online for ready-to-use ComfyUI environment
Reduce image colors for compression, artistic effects, and limited palettes, with dithering support for visual fidelity.
The ImageQuantize node is designed to reduce the number of colors in an image, a process known as color quantization. This technique is particularly useful for compressing images, creating artistic effects, or preparing images for specific display requirements where a limited color palette is needed. By converting an image to use a specified number of colors, the node helps in reducing file sizes and can also enhance the visual style of the image by giving it a more posterized look. The node supports different dithering methods to manage the distribution of quantization errors, ensuring that the resulting image maintains visual fidelity and smooth gradients.
This parameter expects an image tensor that you want to quantize. The image should be in the form of a tensor with dimensions corresponding to batch size, height, width, and color channels.
This parameter specifies the number of colors to which the image will be reduced. The value should be an integer, with a minimum of 1 and a maximum depending on the specific use case. The default value is typically set to a reasonable number that balances image quality and file size.
This parameter determines the dithering method used during quantization. Dithering helps to distribute quantization errors across the image, which can improve the visual quality of the quantized image. The available options are "none" for no dithering, "floyd-steinberg" for Floyd-Steinberg dithering, and "bayer-x" where x
is the order of the Bayer matrix (e.g., "bayer-2", "bayer-4"). The choice of dithering method can significantly affect the appearance of the final image.
The output is a tensor representing the quantized image. This tensor has the same dimensions as the input image tensor but with the colors reduced according to the specified parameters. The result maintains the batch size, height, width, and color channels of the original image, ensuring compatibility with subsequent processing steps.
colors
parameter and different dithering methods.colors
parameter to match the device's color palette.dither
parameter is set to one of the following: "none", "floyd-steinberg", or "bayer-x" where x
is a valid order number.colors
parameter is set to a value that is either too low or too high.colors
parameter to a reasonable integer value, typically between 1 and 256, depending on your specific needs.© Copyright 2024 RunComfy. All Rights Reserved.