Nodes/Img2color - Extract Colors from Image/Img2Color - Color Palette Extractor
ComfyUI Node

Img2Color - Color Palette Extractor

A ComfyUI node in img2txt with 6 inputs and 8 outputs.

By christian-byrne·Created 2 years ago·Updated 2 years ago· 16
Img2Color - Color Palette Extractor
  • input_image
  • plain_english_colors
  • rgb_colors
  • hex_colors
  • xkcd_colors
  • design_colors
  • common_colors
  • color_types
  • color_families
num_colors5
get_complementaryfalse
k_means_algorithmlloyd
accuracy60
exclude_colors
Categoryimg2txt

Inputs (6)

NameTypeDefaultDescription
input_imageIMAGE
num_colorsoptINT51–128Number of colors to detect
get_complementaryoptBOOLEANfalseGet the complementary colors of the detected palette
k_means_algorithmoptCOMBOlloyd4 options: lloyd, elkan, auto, full
accuracyoptINT601–100Adjusts accuracy by changing number of iterations of the K-means algorithm
exclude_colorsoptSTRINGComma-separated list of colors to exclude from the output

Outputs (8)

NameTypeDescription
plain_english_colorsSTRINGPlain English Colors correspond to the closest named color in the CSS3, CSS2, CSS21, and HTML4 color dictionaries.
rgb_colorsSTRINGRGB Colors are in the format "rgb(255, 0, 255)"
hex_colorsSTRINGHex Colors are in the format #RRGGBB
xkcd_colorsSTRINGXKCD Color is the finest level of granularity, and corresponds to the colors in the XKCD color survey. There are about 950 colors in this space.
design_colorsSTRINGDesign Color is the next coarsest level. There are about 250 Design Colors
common_colorsSTRINGCommon Color is the next coarsest level. There are about 120 Common Colors. This is probably the most useful level for most purposes.
color_typesSTRINGColor Type is another dimension that tells, roughly, how light, dark or saturated a color is. There are 11 color types.
color_familiesSTRINGColor Family is even coarser, and has 26 families. These are all primary, secondary, or tertiary colors, or corresponding values for neutrals.