Visit ComfyUI Online for ready-to-use ComfyUI environment
Converts image colors to mask for segmentation and isolation tasks.
The ImageColorToMask
node is designed to convert specific colors within an image into a mask. This node is particularly useful for isolating and manipulating parts of an image based on color values. By identifying a specific color within the image, the node generates a mask where the specified color is highlighted, and all other colors are excluded. This can be beneficial for tasks such as background removal, object isolation, or any scenario where color-based segmentation is required. The node processes the image by converting it to a format where each pixel's color is compared to the specified target color, creating a binary mask that can be used in further image processing workflows.
The image
parameter expects an input image that you want to process. This image will be analyzed to create a mask based on the specified color. The image should be in a format that the node can interpret, typically a multi-channel image (e.g., RGB or RGBA).
The color
parameter specifies the target color that you want to isolate in the image. This is an integer value representing the color in hexadecimal format (e.g., 0xFFFFFF for white). The node will create a mask where all pixels matching this color are highlighted. The parameter accepts values from 0 to 0xFFFFFF, with a default value of 0. This allows for precise color selection and ensures that the mask accurately represents the desired color.
The MASK
output is a binary mask generated from the input image based on the specified color. In this mask, pixels that match the target color are set to 255 (white), and all other pixels are set to 0 (black). This mask can be used in subsequent image processing steps to isolate or manipulate the parts of the image that match the specified color.
color
parameter. Use a color picker tool to get the exact hexadecimal value of the color you want to isolate.ImageColorToMask
node.MaskComposite
or InvertMask
, to perform more complex image manipulations based on the isolated color regions.color
parameter accordingly.© Copyright 2024 RunComfy. All Rights Reserved.