Visit ComfyUI Online for ready-to-use ComfyUI environment
Calculate average color of image with mean or mode pixel values, supports mask for targeted analysis.
The GetAverageColorFromImage
node is designed to calculate the average color of an image, providing a simple yet powerful tool for AI artists to analyze and utilize color information from their images. This node can compute the average color using either the mean or mode of the pixel values, offering flexibility depending on the desired outcome. By extracting the average red, green, and blue values, you can gain insights into the overall color composition of an image, which can be particularly useful for tasks such as color grading, palette generation, or image analysis. The node also supports the use of a mask to focus the calculation on specific areas of the image, allowing for more targeted color analysis.
This parameter represents the input image from which the average color will be calculated. The image should be provided as a tensor, which is a multi-dimensional array commonly used in machine learning and image processing. The image tensor should have dimensions corresponding to the batch size, height, width, and color channels (typically RGB).
This parameter determines the method used to calculate the average color. It accepts two options: "mean" and "mode". The "mean" option calculates the average color by computing the mean of the pixel values, which provides a smooth and balanced representation of the overall color. The "mode" option calculates the average color by finding the most frequently occurring pixel values, which can highlight dominant colors in the image. The default value is "mean".
This optional parameter allows you to provide a mask that specifies which parts of the image should be included in the average color calculation. The mask should be a tensor with the same height and width as the input image, where each pixel value indicates whether the corresponding pixel in the image should be considered (1) or ignored (0). If no mask is provided, the entire image will be used for the calculation.
This output parameter represents the average red color value of the image or the masked area. The value is a floating-point number between 0 and 255, indicating the intensity of the red channel.
This output parameter represents the average green color value of the image or the masked area. The value is a floating-point number between 0 and 255, indicating the intensity of the green channel.
This output parameter represents the average blue color value of the image or the masked area. The value is a floating-point number between 0 and 255, indicating the intensity of the blue channel.
<method>
© Copyright 2024 RunComfy. All Rights Reserved.