# Core dependencies for color profile reading (minimal) Pillow>=8.0.0 # OCIO support (installed automatically if possible) # opencolorio>=2.0.0 # Optional dependencies for advanced color tools (install separately if needed) # numpy>=1.21.0 # opencv-python>=4.5.0 # scikit-image>=0.18.0 # matplotlib>=3.5.0 # colorspacious>=1.1.0 # colour-science>=0.3.16 # scipy>=1.7.0 # scikit-learn>=1.0.0 # torch>=1.9.0 # Usually provided by ComfyUI # torchvision>=0.10.0 # Usually provided by ComfyUI
A ComfyUI custom node for reading color profiles and color space information from image files. This node extracts ICC profiles, PNG color space chunks, and other color metadata to help you understand the color characteristics of your images.
custom_nodes directory:“`bash
cd ComfyUI/custom_nodes
git clone https://github.com/yourusername/ComfyUI-color-tools.git
“`
“`bash
cd ComfyUI-color-tools
pip install -r requirements.txt
“`
image_path inputprofile_json: Complete profile informationicc_base64: Raw ICC profile dataprimaries_json: Color primaries informationnotes_json: Any additional notes or warningsThe OCIO nodes work with both built-in configurations and custom files:
.ocio file to your desired location (e.g., within your project folder or system config directory)C:\ProgramData\OpenColorIO\config.ocio (Windows)/usr/local/share/OpenColorIO/config.ocio (Linux/Mac).ocio file in the ocio_config_path inputOCIO Config Path: C:\ProgramData\OpenColorIO\config.ocio
Source Color Space: sRGB
Target Color Space: ACEScg
If no config path is specified, the nodes use OCIO’s default built-in configuration.
Use the OCIO Config Info node to see what color spaces are available in your configuration and understand the structure.
The node outputs JSON strings that can be:
What it does: Extracts color profile and color space information from image files. Reads ICC profiles, PNG color space chunks, and other color metadata to understand the color characteristics of your images.
Inputs:
image_path (STRING): Path to the image file (absolute or relative to ComfyUI)Outputs:
profile_json (STRING): Complete color profile metadataicc_base64 (STRING): Raw ICC profile data in Base64 encodingprimaries_json (STRING): Color primaries and white point datanotes_json (STRING): Additional information and warningsWhat it does: Compares gamma values between two images and provides detailed analysis. Detects gamma mismatches that could affect color accuracy and provides recommendations for color management.
Inputs:
image_path_1 (STRING): Path to the first image fileimage_path_2 (STRING): Path to the second image filetolerance (FLOAT): Tolerance for gamma difference detection (0.001-0.1)Outputs:
comparison_json (STRING): Detailed comparison data between the two imagesgamma_analysis (STRING): In-depth gamma analysis and interpretationrecommendations (STRING): Workflow and technical recommendationsWhat it does: Converts images to sRGB or linear sRGB using ICC profiles, PNG color space data, or chromaticity matrices. Provides professional-grade color space conversion with fallback handling.
Inputs:
image (IMAGE): Input image tensortarget_space (COMBO): “sRGB” or “sRGB_linear”icc_profile_base64 (STRING): ICC profile data from ColorProfileReaderpng_srgb_intent (INT): PNG sRGB rendering intent (-1 to 3)png_gamma (FLOAT): PNG gamma valuepng_chromaticity_json (STRING): PNG chromaticity data from ColorProfileReaderOutputs:
image (IMAGE): Converted image in target color spaceWhat it does: Converts images between different color spaces including RGB, HSV, HSL, LAB, XYZ, and CMYK. Supports gamma correction and preserves alpha channels.
Inputs:
image (IMAGE): Input imagesource_space (COMBO): Source color spacetarget_space (COMBO): Target color spacepreserve_alpha (BOOLEAN): Whether to preserve alpha channelgamma_correction (FLOAT): Gamma correction valueOutputs:
image (IMAGE): Converted imageconversion_info (STRING): Conversion detailsWhat it does: Adjusts color temperature and tint of images. Simulates warm/cool lighting conditions and provides fine control over color balance.
Inputs:
image (IMAGE): Input imagetemperature (FLOAT): Temperature adjustment (-100 to 100)tint (FLOAT): Tint adjustment (-100 to 100)Outputs:
image (IMAGE): Temperature-adjusted imageWhat it does: Analyzes color space properties and provides detailed information about image characteristics. Generates recommendations for color management.
Inputs:
image (IMAGE): Input imageOutputs:
color_space_info (STRING): Color space informationcolor_stats (STRING): Color statisticsrecommendations (STRING): Color management recommendationsWhat it does: Adjusts color balance for shadows, midtones, and highlights separately. Provides professional color correction capabilities similar to video editing software.
Inputs:
image (IMAGE): Input imageshadow_red/green/blue (FLOAT): Shadow color adjustmentsmidtone_red/green/blue (FLOAT): Midtone color adjustmentshighlight_red/green/blue (FLOAT): Highlight color adjustmentsOutputs:
image (IMAGE): Color-balanced imageWhat it does: Adjusts brightness and contrast of images. Provides precise control over exposure and contrast levels.
Inputs:
image (IMAGE): Input imagebrightness (FLOAT): Brightness adjustment (-1.0 to 1.0)contrast (FLOAT): Contrast adjustment (0.0 to 3.0)Outputs:
image (IMAGE): Adjusted imageWhat it does: Adjusts color saturation while optionally preserving luminance. Can boost or reduce color intensity.
Inputs:
image (IMAGE): Input imagesaturation (FLOAT): Saturation multiplier (0.0 to 3.0)preserve_luminance (BOOLEAN): Whether to preserve luminanceOutputs:
image (IMAGE): Saturation-adjusted imageWhat it does: Shifts hue values of images. Useful for color correction and creative color effects.
Inputs:
image (IMAGE): Input imagehue_shift (FLOAT): Hue shift in degrees (-180 to 180)Outputs:
image (IMAGE): Hue-shifted imageWhat it does: Applies gamma correction to images. Essential for proper color management and display calibration.
Inputs:
image (IMAGE): Input imagegamma (FLOAT): Gamma value (0.1 to 5.0)Outputs:
image (IMAGE): Gamma-corrected imageWhat it does: Extracts dominant colors from images using K-means clustering. Useful for color palette generation and color scheme analysis.
Inputs:
image (IMAGE): Input imagenum_colors (INT): Number of colors to extract (1-20)color_format (COMBO): Output format (RGB, HSV, HEX)Outputs:
dominant_colors (STRING): Extracted colors as JSONcolor_percentages (STRING): Color percentages as JSONWhat it does: Generates color histograms for analysis. Provides detailed color distribution information across different color spaces.
Inputs:
image (IMAGE): Input imagebins (INT): Number of histogram bins (32-512)histogram_type (COMBO): Color space for histogram (RGB, HSV, LAB)Outputs:
histogram_data (STRING): Histogram data as JSONstatistics (STRING): Color statistics as JSONWhat it does: Generates comprehensive color palettes from images using various quantization methods. Creates color schemes for design workflows.
Inputs:
image (IMAGE): Input imagepalette_size (INT): Number of colors in palette (3-32)palette_type (COMBO): Quantization method (K-means, Median Cut, Octree)Outputs:
palette (STRING): Color palette as JSONpalette_info (STRING): Palette information as JSONWhat it does: Finds colors similar to a target color based on color distance. Useful for color matching and replacement workflows.
Inputs:
image (IMAGE): Input imagetarget_color (STRING): Target color (hex or RGB)similarity_threshold (FLOAT): Similarity threshold (0.0-1.0)color_space (COMBO): Color space for comparison (RGB, HSV, LAB)Outputs:
mask (IMAGE): Similarity masksimilarity_info (STRING): Similarity analysis as JSONWhat it does: Analyzes color harmony and relationships in images. Evaluates complementary, triadic, analogous, and other color harmony types.
Inputs:
image (IMAGE): Input imageharmony_type (COMBO): Type of harmony to analyzeOutputs:
harmony_analysis (STRING): Harmony analysis as JSONcolor_relationships (STRING): Color relationships as JSONWhat it does: Matches and replaces colors in images. Supports exact, similar, and hue-only matching modes for color correction workflows.
Inputs:
image (IMAGE): Input imagesource_color (STRING): Color to matchtarget_color (STRING): Replacement colortolerance (FLOAT): Matching tolerance (0.0-1.0)replace_mode (COMBO): Replacement mode (Exact, Similar, Hue Only)Outputs:
image (IMAGE): Color-matched imagereplacement_info (STRING): Replacement statistics as JSONWhat it does: Reduces the number of colors in images using various quantization methods. Useful for creating indexed color images and artistic effects.
Inputs:
image (IMAGE): Input imagenum_colors (INT): Target number of colors (2-256)quantization_method (COMBO): Quantization method (K-means, Median Cut, Octree, Uniform)dithering (BOOLEAN): Whether to apply ditheringOutputs:
image (IMAGE): Quantized imagequantization_info (STRING): Quantization statistics as JSONWhat it does: Maps colors between different color gamuts. Essential for color management when working with different display technologies.
Inputs:
image (IMAGE): Input imagesource_gamut (COMBO): Source color gamuttarget_gamut (COMBO): Target color gamutmapping_method (COMBO): Gamut mapping method (Perceptual, Relative, Saturation, Absolute)Outputs:
image (IMAGE): Gamut-mapped imagemapping_info (STRING): Mapping information as JSONWhat it does: Simulates different types of color blindness. Useful for accessibility testing and understanding how color-blind users perceive images.
Inputs:
image (IMAGE): Input imagecolor_blindness_type (COMBO): Type of color blindness to simulateseverity (FLOAT): Simulation severity (0.0-1.0)Outputs:
image (IMAGE): Simulated imagesimulation_info (STRING): Simulation details as JSONWhat it does: Professional color space conversions using OpenColorIO configurations. Supports industry-standard color pipelines and professional color management.
Inputs:
image (IMAGE): Input image tensorocio_config_path (STRING): Path to .ocio configuration file (optional)source_colorspace (STRING): Source color space nametarget_colorspace (STRING): Target color space nameOutputs:
image (IMAGE): Converted image in target color spaceconversion_info (STRING): Conversion details and metadataWhat it does: Displays information about OCIO configurations, including available color spaces, displays, and viewing transforms.
Inputs:
ocio_config_path (STRING): Path to .ocio configuration file (optional)Outputs:
config_info (STRING): Detailed configuration informationWhat it does: Generates test patterns for color space validation and calibration. Creates color bars, tone ramps, SMPTE color bars, and ColorChecker-like patterns essential for testing OCIO transforms.
Inputs:
pattern_type (COMBO): Type of test pattern (Color Bars, Tone Ramp, Gray Ramp, SMPTE Color Bars, ColorChecker)width (INT): Pattern width in pixelsheight (INT): Pattern height in pixelsOutputs:
test_pattern (IMAGE): Generated test pattern imagepattern_info (STRING): Description of the generated patternRecommended workflow: Generate test patterns, convert them through OCIO color spaces, and visually compare results to validate color accuracy.
{
"container": "PNG",
"pillow_mode": "RGB",
"icc_present": true,
"icc_profile_name": "sRGB IEC61966-2.1",
"icc_summary": {
"profile_class": "mntr",
"pcs": "XYZ ",
"acsp_sanity": true
},
"srgb_chunk_intent": 0,
"gamma": 0.45455,
"chromaticity": {
"wx": 0.3127,
"wy": 0.3290,
"rx": 0.64,
"ry": 0.33,
"gx": 0.30,
"gy": 0.60,
"bx": 0.15,
"by": 0.06
}
}
Pillow>=8.0.0: Image processing and ICC profile supportopencolorio>=2.0.0: Professional color management (OCIO nodes)ComfyUI-color-tools/
├── README.md
├── LICENSE
├── requirements.txt
├── pyproject.toml
├── __init__.py
├── nodes/
│ ├── __init__.py
│ ├── advanced_tools.py
│ ├── color_analysis.py
│ ├── color_conversion.py
│ ├── color_converter_advanced.py
│ ├── color_grading.py
│ ├── color_profile_convert.py
│ ├── color_profile_convert_simple.py
│ ├── color_profile_reader.py
│ └── ocio_tools.py (OpenColorIO integration)
└── examples/
└── color_profile_workflow.json
MIT License – See LICENSE file for details.
For issues, feature requests, or questions:
Author: Pablo Apiolazza
Repository: ComfyUI-color-tools
Category: Image/Color