ComfyUI Extension: ComfyUI Color Profile Reader
A comprehensive collection of color manipulation and analysis nodes for ComfyUI
Custom Nodes (0)
README
ComfyUI Color Profile Reader
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.
šØ Features
Color Profile Detection
- ICC Profile Extraction: Reads embedded ICC color profiles from images
- PNG Color Space Support: Extracts sRGB, gamma, and chromaticity data from PNG files
- Multi-format Support: Works with JPEG, PNG, TIFF, WEBP, and other formats supported by Pillow
- Profile Analysis: Provides detailed information about color profiles and color spaces
Gamma Comparison
- Gamma Analysis: Compares gamma values between two images
- Standard Gamma Detection: Identifies common gamma values (sRGB, Rec. 709, Rec. 2020, etc.)
- Tolerance-based Comparison: Configurable tolerance for gamma difference detection
- Detailed Recommendations: Provides workflow and technical recommendations for gamma mismatches
Output Information
- Profile JSON: Complete color profile metadata in JSON format
- ICC Base64: Raw ICC profile data encoded in Base64
- Primaries JSON: Color primaries and white point information
- Notes JSON: Any warnings or additional information about the image
š Installation
Method 1: ComfyUI Manager (Recommended)
- Open ComfyUI
- Go to Manager ā Install
- Search for "ComfyUI Color Profile Reader"
- Click Install
Method 2: Manual Installation
-
Clone this repository to your ComfyUI
custom_nodes
directory:cd ComfyUI/custom_nodes git clone https://github.com/yourusername/ComfyUI-color-tools.git
-
Install dependencies:
cd ComfyUI-color-tools pip install -r requirements.txt
-
Restart ComfyUI to load the new node
š Usage
Basic Color Profile Reading
- Add a "Color Profile Reader" node from the "Image/Color" category
- Connect an image path (string) to the
image_path
input - The node will output:
profile_json
: Complete profile informationicc_base64
: Raw ICC profile dataprimaries_json
: Color primaries informationnotes_json
: Any additional notes or warnings
Workflow Integration
The node outputs JSON strings that can be:
- Displayed in Text nodes for inspection
- Used with Conditional nodes for branching logic
- Processed by other nodes that accept string inputs
- Saved to files for further analysis
š ļø Node Details
š Color Profile Nodes
Color Profile Reader
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 warnings
Gamma Compare
What 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 recommendations
Color Profile ā sRGB / Linear
What 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 ColorProfileReader
Outputs:
image
(IMAGE): Converted image in target color space
š Color Conversion Nodes
Color Space Converter
What 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 value
Outputs:
image
(IMAGE): Converted imageconversion_info
(STRING): Conversion details
Color Temperature
What 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 image
Color Space Analyzer
What it does: Analyzes color space properties and provides detailed information about image characteristics. Generates recommendations for color management.
Inputs:
image
(IMAGE): Input image
Outputs:
color_space_info
(STRING): Color space informationcolor_stats
(STRING): Color statisticsrecommendations
(STRING): Color management recommendations
šØ Color Grading Nodes
Color Balance
What 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 adjustments
Outputs:
image
(IMAGE): Color-balanced image
Brightness/Contrast
What 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 image
Saturation
What 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 luminance
Outputs:
image
(IMAGE): Saturation-adjusted image
Hue Shift
What 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 image
Gamma Correction
What 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 image
š Color Analysis Nodes
Dominant Colors
What 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 JSON
Color Histogram
What 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 JSON
Color Palette
What 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 JSON
Color Similarity
What 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 JSON
Color Harmony
What 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 analyze
Outputs:
harmony_analysis
(STRING): Harmony analysis as JSONcolor_relationships
(STRING): Color relationships as JSON
š§ Advanced Tools Nodes
Color Matcher
What 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 JSON
Color Quantizer
What 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 dithering
Outputs:
image
(IMAGE): Quantized imagequantization_info
(STRING): Quantization statistics as JSON
Gamut Mapper
What 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 JSON
Color Blind Simulator
What 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 JSON
Profile JSON Structure
{
"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
}
}
š Use Cases
Color Management Workflows
- Verify color profiles in source images
- Ensure proper color space handling in processing pipelines
- Detect color profile mismatches that could affect output quality
- Compare gamma values between images for consistency
Image Analysis
- Analyze color characteristics of reference images
- Extract color space information for documentation
- Validate color profile compliance
- Detect gamma mismatches that could cause color shifts
Quality Control
- Check for missing or incorrect color profiles
- Verify color space consistency across image sets
- Monitor color profile usage in production workflows
- Ensure gamma consistency in multi-image projects
Gamma Comparison Workflows
- Compare gamma values between source and output images
- Detect gamma mismatches in color pipelines
- Analyze gamma characteristics for color space identification
- Generate recommendations for gamma correction
š§ Dependencies
Pillow>=8.0.0
: Image processing and ICC profile support
š Project Structure
ComfyUI-color-tools/
āāā README.md
āāā LICENSE
āāā requirements.txt
āāā __init__.py
āāā color_profile_reader.py
āāā examples/
āāā color_profile_workflow.json
š¤ Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
š License
MIT License - See LICENSE file for details.
š Support
For issues, feature requests, or questions:
- Open an issue on GitHub
- Check the documentation
- Review example workflows
š Version History
- v1.0.0: Initial release with color profile reading functionality
š Acknowledgments
- ComfyUI community for the excellent framework
- Pillow team for image processing capabilities
- ICC profile specification contributors
Author: Pablo Apiolazza
Repository: ComfyUI-color-tools
Category: Image/Color