Nodes/ComfyUI Color Profile Reader/Read Image Color Profile
ComfyUI Node

Read Image Color Profile

What color space is that image actually in? Stop guessing and read the profile

By APZmedia·Created 11 months ago·Updated 5 months ago· 7
Read Image Color Profile
    • profile_json
    • icc_base64
    • primaries_json
    • notes_json
    image_path

    This is the node that names the whole pack. "ComfyUI Color Profile Reader" is the pack's title, and ColorProfileReader is the reason it exists: it tells you what color profile and color space a file on disk actually carries - embedded ICC profile, PNG gamma and chromaticity chunks, rendering intent, the works. If you've ever had an image come out washed out or oversaturated and guessed at which color space fix to apply, this is the "look before you leap" step you were skipping.

    The one thing to know first

    It takes a file path, not an image tensor. The image_path input is a plain string pointing at the file on disk - drag an image from ComfyUI's sidebar, or type a path like C:\Users\you\Pictures\scan.jpg. You can't feed this node the IMAGE output of a Load Image or VAE Decode node. That trips up more people than anything else here, because nearly every other image node in ComfyUI eats tensors. If your image lives inside a workflow rather than on disk, this node has nothing to read.

    How it works

    Pillow does the heavy lifting via ImageCms, but the interesting part is that the code also parses PNG color chunks by hand - the iCCP, sRGB, gAMA, and cHRM chunks that carry an image's gamma and primaries. That's why it can tell you a PNG's gamma (like 0.45455, the display-exponent inverse of sRGB's 2.2) and its exact chromaticity coordinates even when there's no ICC profile embedded. For ICC profiles it extracts the raw bytes and also summarizes the header: profile class (mntr = monitor, prtr = printer...), the profile connection space, and a sanity check on the acsp signature.

    The four outputs

    All four are strings, which is fine - they're data, not pixels:

    • profile_json - the complete picture: container, Pillow mode, ICC presence and name, PNG gamma, chromaticity, sRGB intent.
    • icc_base64 - the raw ICC profile as Base64, handy for embedding or for feeding back into the conversion nodes.
    • primaries_json - the RGB primaries and white point.
    • notes_json - warnings, like "iCCP parse error" or "Not a PNG signature."

    Wire them into a Show Text node to read them, or feed profile_json straight into the pack's ColorProfileConvert / ColorConverterAdvanced nodes so the conversion uses the profile you just read instead of assuming.

    Install

    Search "ComfyUI Color Profile Reader" in ComfyUI Manager and install, or clone manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/APZmedia/ComfyUI-color-tools
    

    Then restart. Two gotchas: the README's manual-clone snippet says yourusername/ComfyUI-color-tools.git - that's a placeholder, use APZmedia/ in the URL or it 404s. And the pack runs an install.py on every startup that checks for optional deps and pip-installs whatever's missing, so the first launch after installing can hang for a couple minutes while opencv/scipy/sklearn go in. That's normal, not a crash. The core reader itself only needs Pillow, which ComfyUI already has.

    Common issues

    Most problems here are file problems, not node problems: the path doesn't exist, the format isn't one Pillow reads, or the file simply has no color metadata (plenty of JPEGs out there carry no ICC profile at all - you'll get the metadata fields back but icc_present: false). The node degrades gracefully and notes what it couldn't parse rather than exploding. When in doubt, check notes_json first; it exists precisely to tell you what went sideways.

    CategoryImage/Color

    Inputs (1)

    NameTypeDefaultDescription
    image_pathSTRING

    Outputs (4)

    NameTypeDescription
    profile_jsonSTRING
    icc_base64STRING
    primaries_jsonSTRING
    notes_jsonSTRING