Visit ComfyUI Online for ready-to-use ComfyUI environment
Transform images into pixel art with reduced color palette and pixelization techniques for retro-style graphics and simplified images.
The PixelArtDetectorConverter node is designed to transform images into pixel art by reducing the color palette and applying various pixelization techniques. This node is particularly useful for AI artists who want to create retro-style graphics or simplify images for stylistic purposes. It leverages both PIL (Python Imaging Library) and OpenCV to offer flexible and efficient color quantization methods, ensuring high-quality results. The node can handle different dithering techniques and allows for palette swapping, making it a versatile tool for generating pixel art from any image. By using this node, you can achieve a distinct pixelated look that is reminiscent of classic video games and digital art.
This parameter determines the method used for color quantization. Options include Image.quantize
for using PIL's quantization method and OpenCV.kmeans.reduce
for using OpenCV's k-means clustering. The choice of method impacts the quality and style of the pixel art. Image.quantize
is generally faster and suitable for simpler images, while OpenCV.kmeans.reduce
offers more control and can handle more complex images.
This parameter specifies the dithering technique to be applied before quantization. Options include none
, floyd-steinberg
, bayer-2
, bayer-4
, bayer-8
, and bayer-16
. Dithering helps to reduce color banding and create a smoother transition between colors. floyd-steinberg
is a popular choice for its balance between quality and performance, while the bayer
options offer different levels of dithering intensity.
A boolean parameter that, when enabled, cleans up stray colors that may not fit well with the overall palette. This helps in achieving a more cohesive look. The default value is False
.
This parameter sets the threshold for cleaning up stray pixels. It is a float value ranging from 0.001 to 1.0, with a default value of 0.02. Lower values result in more aggressive cleanup, while higher values are more lenient.
A boolean parameter that determines whether the image should be resized before applying pixelization. This can be useful for optimizing performance and ensuring that the pixel art maintains its intended resolution. The default value is False
.
This parameter sets the width to which the image should be resized if resizeBefore
is enabled. It is an integer value and should be set according to the desired output dimensions.
This parameter sets the height to which the image should be resized if resizeBefore
is enabled. It is an integer value and should be set according to the desired output dimensions.
The primary output of the node is the pixelated image, represented as a PIL (Python Imaging Library) image object. This output can be further processed or saved as needed. The pixelated image will have reduced colors and a distinct pixel art style, making it suitable for various artistic applications.
Image.quantize
method for simpler images and OpenCV.kmeans.reduce
for more complex images.cleanup_colors
to ensure a more cohesive color palette, especially when working with images that have a lot of stray colors.resizeBefore
parameter to optimize performance and maintain the intended resolution of your pixel art.pixelize
parameter is set to either Image.quantize
or OpenCV.kmeans.reduce
.dither
parameter is set to one of the supported options: none
, floyd-steinberg
, bayer-2
, bayer-4
, bayer-8
, or bayer-16
.resize_w
and resize_h
are set to values above the minimum resize threshold specified in the settings.© Copyright 2024 RunComfy. All Rights Reserved.