ComfyUI Node
CV Find Absent Color (Lab)
Finds a CSS named color that does not appear in the image and sits furthest (in L*a*b*) from the colors that do. Converts the image to L*a*b*, measures each of the 148 CSS named colors' distance to its nearest pixel (Euclidean L2 or Manhattan L1), treats colors within 'threshold' as present, and returns the absent color with the greatest distance - its RGB scalar, CSS name and #RRGGBB hex. If every color is present, 'found' is false and the returned color is still the one furthest from the image's existing colors.
CV Find Absent Color (Lab)
- image
- color_rgb
- color_name
- color_hex
- distance
- found
◄metricEuclidean (L2)►
◄threshold10.0►
◄max_pixels200000►
Categoryimage/CV
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Input image. A batch is accepted: a color counts as present when it occurs in ANY frame. | |
| metric | COMBO | Euclidean (L2) | Distance in L*a*b* space: Euclidean (L2) is the classic delta-E; Manhattan (L1) sums the channel differences and is cheaper to reason about per channel. |
| threshold | FLOAT | 10.00–255 | A CSS color counts as present when any pixel is within this Lab distance (OpenCV L*a*b* uint8 space: L 0-255, a/b 0-255). 0 = only an exact match counts; larger = more colors considered present. |
| max_pixelsopt | INT | 2000001000–100000000 | Per-frame cap on pixels searched, applied as an even deterministic stride so big images stay fast. A color present in only a few pixels below this stride may be missed - raise it for large canvases. |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| color_rgb | NPARRAY | CV Scalar (r, g, b) float64 of the chosen CSS color (the image arrives in RGB, so the color is returned in the same order). |
| color_name | STRING | CSS name of the chosen color, lowercase (e.g. 'rebeccapurple'). |
| color_hex | COLOR | Hex as #RRGGBB uppercase, typed as a COLOR socket - links straight into ComfyUI color-picker inputs (e.g. 'CV Color From Hex'). |
| distance | FLOAT | Lab distance of the chosen color to its nearest image pixel (its distance to the existing colors). |
| found | BOOLEAN | True when an absent color exists (distance above the threshold). False when every CSS color is present - the color is then still the furthest of the 148 from the existing colors. |