Color Histogram
The numbers behind your image's color distribution
- image
- histogram_data
- statistics
ColorHistogram is the node that turns "this image feels dark and muddy" into a number you can act on. It computes a per-channel histogram of your image in RGB, HSV, or LAB, and hands you the histogram data plus per-channel statistics (mean, standard deviation, min, max, median) as JSON. No image comes out the other end - this is a diagnostic node, and its job is to give you the color distribution as structured data you can read, log, or pipe into another node.
How it works
For RGB it just histograms the three channels directly. For HSV and LAB it converts the image with OpenCV first (cv2.cvtColor), then histograms the Hue/Saturation/Value or L/A/B channels. Everything is plain numpy under the hood: np.histogram per channel, then a stats object per channel. The output structure is clean - histogram_data gives you {channels, histograms, bins} and statistics gives per-channel {mean, std, min, max, median}.
The inputs that matter
- bins - 32 to 512, default 256, stepped by 32. Default is a good general-purpose resolution. Bump toward 512 when you're hunting for subtle banding or color casts; drop to 32 for a quick coarse read.
- histogram_type - RGB, HSV, or LAB. The interesting one is LAB: an L histogram tells you about exposure/luminance independently of color, which is a better tool for spotting "why is this dark" than the RGB channels. HSV is your friend when you suspect a saturation or hue problem.
How to actually use the output
The catch - and it's worth being straight about it - is that this node returns data, not a picture. ComfyUI's built-in histogram/scope nodes are more visual, and if you just want to look at a histogram, the pack's own VectorScope (ships in the same pack) or a visual scope node is more satisfying. ColorHistogram earns its keep when you want the distribution as numbers: feed histogram_data into a text node, compare two generations' stats programmatically, or log them to catch a pipeline that's gradually crushing highlights. The mean/median pair is the fastest health check - if mean L is climbing across a batch, something in your chain is brightening images.
Install
Same pack, same drill:
cd ComfyUI/custom_nodes
git clone https://github.com/APZmedia/ComfyUI-color-tools
Or ComfyUI Manager → search "ComfyUI Color Profile Reader" → Install → restart. Mind the README's placeholder clone URL (yourusername/... - it's APZmedia/ComfyUI-color-tools). HSV and LAB modes need OpenCV, which install.py installs as an optional dependency on startup; if the first launch is slow, that's pip grinding through opencv + scipy + sklearn, and it only happens once. If this node's missing from your list while reader nodes show up, check the startup log for the analysis-group warning.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| bins | INT | 25632–512 | — |
| histogram_type | COMBO | RGB | 3 options: RGB, HSV, LAB |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| histogram_data | STRING | — |
| statistics | STRING | — |