Using the Pixel Analyzer

Nuke’s Pixel Analyzer enables you to analyze single and multiple pixels, or the entire image, and compare color values between Viewers. The analyzer stores current, minimum and maximum, average, and median values which can then be copied by value to controls on other nodes. For example, you might use the minimum and maximum values from an analysis to set the black and white points on another image. The analyzer is accessed from the contents menu Windows sub-menu.

The Pixel Analyzer has two modes:

pixel selection - the default mode, allows you to make single or multiple pixel selections in the Viewer for analysis. You can also analyze an area of the Viewer using a Region of Interest tool.

full frame - analyzes the contents of the current frame, regardless of any selections you’ve made in the Viewer.

By default, full frame samples the visible region of the Viewer. As a result, actions that change the visible area, such as zooming in and out, alter the available color values.

Note:  The Preferences >Panels > Scopes > Include Viewer color transforms control does not affect the Pixel Analyzer.

Analyzing Pixel Selections

The analyzer’s pixel selection mode allows you to select pixels in the Viewer, individually or as a group, and display the color information in swatches. To make selections in the Viewer:

1.   Connect a Viewer to the output you intend to analyze. You can connect multiple Viewers to a single output, and vice versa, for comparison.
2.   Click the contents menu and select Windows > Pixel Analyzer.

The Pixel Analyzer panel displays.

3.   Use the sample dropdowns to control which Viewer and layer provides the swatch information:

viewer - the default, current viewer, always samples the active Viewer if there is more than one. Selecting pixels in a Viewer or clicking on a Viewer’s tab causes the Viewer to become the active or current Viewer. Alternatively, you can select a named Viewer from the dropdown when more than one is open.

layer - the default, current layer, displays the layer(s) specified in the Viewer channels dropdown.

Note:  If rgba channels are not present, the first four available channel values are written into the Pixel Analyzer’s rgba controls.

Note:  The color swatches may not update immediately if you select a layer from the sample dropdown that is not currently visible in the Viewer, because the new layer must be rendered in the background before the swatch is calculated.

Alternatively, you can select a named layer from the dropdown. When switching between Viewers, the Pixel Analyzer attempts to match the selected layer in the new Viewer. If that layer doesn't exist, the default current layer is displayed.

Tip:  You can use the layer dropdown to sample a layer that is not displayed in the Viewer, allowing you to compare position and color values between layers.

4.   Ensure that the mode dropdown is set to pixel selection.
5.   If you want to make multiple selections, without losing your previous selections, enable accumulate.
6.   There are three methods of selecting pixels for analysis:

single - hold Ctrl/Cmd and click in the Viewer to select a pixel to add it to the swatches.

multiple - hold Ctrl/Cmd and click-and-drag in the Viewer to select multiple pixels as you move the pointer.

region - hold Ctrl/Cmd+Shift and click-and-drag in the Viewer to create a Region of Interest. Adjust or move the ROI using the Viewer handles.

Tip:  To deselect all pixels, hold Ctrl/Cmd and right-click in the Viewer.

With multiple selections in the Viewer, the color swatches provide the following information:

current - the color value of the last pixel selected.

min/max - the darkest and brightest color values from the selection.

average - the mean average color value from the selection.

median - the mid-point color between the darkest and brightest colors in the selection.

You can enable live median update to calculate the median swatch dynamically, rather than at pen-up.

Note:  In single mode, all swatches show identical information and in region mode, the current swatch is disabled.

7.   Click on the swatches to display rgba and hsvl color values for the selected swatch.

The Pixel Analyzer also detects inf (infinite) and nan (not a number) color values. The ! point in the swatch indicates inf/nan values.

8.   You can reset the swatches at any time by clicking clear selection, except when full frame mode is enabled, in which case the button is grayed out.
9.   Use the range dropdown to select the color bit-depth you intend to display. For example, selecting 8-bit limits your color values to 255.
10.   Set the min/max channel you want to use to calculate the min/max color swatches.

This control defaults to luminance (l), but if you wanted to display the minimum values in only the red channel, for example, you could set min/max to red (r).

Analyzing Full Frames

The analyzer’s full frame mode samples the visible region of the Viewer by default. As a result, actions that change the visible area, such as zooming in and out, alter the available color values.

Note:  Enabling full frame processing forces the Pixel Analyzer to analyze the entire frame, regardless of the portion of the Viewer currently visible.

1.   Connect a Viewer to the output you intend to analyze. You can connect multiple Viewers to a single output, and vice-versa, for comparison.
2.   Click the contents menu and select Pixel Analyzer.

The Pixel Analyzer panel displays.

3.   Use the sample dropdowns to control which Viewer and layer provides the swatch information:

viewer - the default, current viewer, always samples the active Viewer if there is more than one. Selecting pixels in a Viewer or clicking on a Viewer’s tab causes the Viewer to become the active or current Viewer. Alternatively, you can select a named Viewer from the dropdown when more than one is open.

layer - the default, current layer, displays the layer(s) specified in the Viewer channels dropdown.

Note:  If rgba channels are not present, the first four available channel values are written into the Pixel Analyzer’s rgba controls.

Note:  The color swatches may not update immediately if you select a layer from the sample dropdown that is not currently visible in the Viewer, because the new layer must be rendered in the background before the swatch is calculated.

Alternatively, you can select a named layer from the dropdown. When switching between Viewers, the Pixel Analyzer attempts to match the selected layer in the new Viewer. If that layer doesn't exist, the default current layer is displayed.

Tip:  You can use the layer dropdown to sample a layer that is not displayed in the Viewer, allowing you to compare position and color values between layers.

4.   Ensure that the mode dropdown is set to full frame.
5.   Click on the swatches to display rgba and hsvl color values for the selected swatch.

The Pixel Analyzer also detects inf (infinite) and nan (not a number) color values. The ! point in the swatch indicates inf/nan values.

6.   Use the range dropdown to select the color bit-depth you intend to display. For example, selecting 8-bit limits your color values to 255.
7.   Set the min/max channel you want to use to calculate the min/max color swatches.

This control defaults to luminance (l), but if you wanted to display the minimum values in only the red channel, for example, you could set min/max to red (r).

Applying Analysis Data

You can use color information stored in the Pixel Analyzer swatches in any other control that includes a swatch. For example, min/max color swatches analyzed in another shot can be applied to the current shot by dragging the swatch to the Grade nodes’s blackpoint and whitepoint controls.