Nodes/ComfyUI Color Profile Reader/Convert Image Color Space
ComfyUI Node

Convert Image Color Space

The easy way to sRGB or linear, using the profile you just read

By APZmedia·Created 11 months ago·Updated 5 months ago· 7
Convert Image Color Space
  • image
  • converted_image
  • conversion_info
profile_json
output_modesRGB

If you've read ColorProfileReader and now know a file's gamma is off, this is the node that fixes it. ColorProfileConvert takes an image tensor, reads the profile JSON you extracted, and converts the image to a target space - sRGB or linear sRGB. It's the "simple" half of the pack's conversion story: few knobs, does one job, hard to mess up. The README calls it "Color Profile → sRGB / Linear," which is a fair description of what it actually does.

How it works

It parses the profile_json string, and if the profile carries a gamma value and you've asked for Linear sRGB, it linearizes by raising the image to that gamma - the standard out = in^gamma un-encode. If the profile has no gamma, or you're targeting plain sRGB, it mostly passes the image through and reports what it found. In other words, it's a profile-aware gamma transfer, not a full matrix-based gamut conversion. That's a feature: it stays predictable with a minimal dependency footprint.

The inputs that matter

  • image - an IMAGE tensor from anywhere in your graph.
  • profile_json - the JSON string from ColorProfileReader. This is the whole point of the node: it uses real profile data instead of a guess. If you leave it empty, you get the image back untouched with a "No profile data provided" note.
  • output_mode - the two choices: sRGB or Linear sRGB. If you're feeding a model that expects linear light (some img2img, some post-processing chains), Linear sRGB is what you want; sRGB is the safe display-space default.

Outputs are converted_image (the tensor you keep wiring forward) and conversion_info, a JSON string recording original size, whether a profile was found, the gamma, and whether it was applied. Useful for logging, ignorable otherwise.

A real workflow

Typical usage: Load Image → (you know the file path) → ColorProfileReader → ColorProfileConvert → rest of your chain.

Load Image ──► ColorProfileConvert ──► (linear image to model)
                    ▲
ColorProfileReader ─┘   (profile_json)

That's the pack's own intended flow, and it's a nice example of why JSON-string outputs exist in ComfyUI at all - one node produces structured data, another consumes it.

Install and gotchas

ComfyUI Manager, search "ComfyUI Color Profile Reader," or:

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

Restart after. Watch out for the README's placeholder clone URL (yourusername/... - it's APZmedia/ComfyUI-color-tools), and the fact that install.py runs a dependency sweep on every startup, so the first launch can sit there a while pip-installing optional packages. This node itself only needs Pillow.

If you need more control - choosing primaries, gamma modes, Adobe/ProPhoto targets - the pack's ColorConverterAdvanced is the heavier sibling. If you need real ICC-profile conversion with rendering intents, that's LittleCMSColorProfileConverter. ColorProfileConvert is deliberately the boring middle option: read the profile, apply it, move on.

CategoryImage/Color

Inputs (3)

NameTypeDefaultDescription
imageIMAGE
profile_jsonSTRING
output_modeCOMBOsRGB2 options: sRGB, Linear sRGB

Outputs (2)

NameTypeDescription
converted_imageIMAGE
conversion_infoSTRING