Houdini 20.5 Nodes Copernicus nodes

Histogram Copernicus node

Builds a histogram from a layer.

On this page

This operation creates a histogram from an incoming layer. This can be output either as a series of horizontal bars whose intensity varies with the number of pixels that are in each bucket; or as a bargraph displaying the output.

This works by defining a range and a number of buckets. Each pixel in the source layer then adds its channels to the corresponding buckets. The count of pixels in the buckets then show the distribution of values in the source layer.

Note if Alpha is in the source the result will have alpha-colored bars, that likely will clip out.

NOTE: If you want to move the range of a grayscale image, consider the Remap COP instead.

Parameters

Signature

The layer type that the source accepts.

See Signatures for more information.

Mode

What sort of histogram to build.

Colored Bars

A horizontal ramp. Each vertical line will be colored by how many pixels in the source fell in that bucket range. If the source has alpha, that affects the bars so may result in clipping.

Separate Bars

A separate horizontal bar is made per channel. Each bar is grayscale, with red being the bottom bar and alpha, if present, the top bar.

Graph

Rather than control intensity of the bar, control how high the bar is drawn. Each channel is done independently, resulting in a mixture of red, green, blue, and alpha bars overlapping.

Buckets

Minimum

Maximum

Outside Values

How to deal with pixel values that lie outside of the histogram range. Note discarding and clamping is done per-channel, so the totals of each channel may not be the same if discarding is done.

Discard

Values outside of the range are ignored and do not contribute to the histogram.

Clamp

Values outside of the range contribute to either the first or last bucket. This causes these buckets to have extreme values as they get all the outliers, but can be useful to judge how much has been cropped out by the window.

Scale

The intensity or height of a bar is based on the percentage of total pixels that fell into that bucket. With many buckets, this tends to be small, so this scale factor will boost the value to make for a more legible chart.

Channel Scope

Controls which channels will be used for histogram generation. Note the number of bars or channels will be unchanged, unscoped channels will just have zero contributions.

Inputs

source

A Mono, UV, RGB, or RGBA layer to build a histogram for.

active

A Mono layer specifying a region of pixels to use for the histogram. Only pixels where the active layer is greater than or equal to 0.5 will contribute to the histogram.

Outputs

histogram

A layer of the same type and size as the source, but with a pictorial histogram written to it according to the Mode.

counts

An ID layer that stores the raw bucket values. Its width will be the number of buckets, and height will be 5. The first four rows (from the bottom) are the red, green, blue, and alpha histogram counts. The last row contains the total number of processed pixels in the 0th column.

See also

Copernicus nodes