Skip to content

Levels

Remaps input and output brightness ranges with gamma correction, per-channel or on the master. Includes a live histogram display.

Category: Color Menu path: Color > Levels

Ports

PortTypeDirectionDescription
inimageRgba16finputInput image
outimageRgba16foutputAdjusted result

Parameters

The Levels node has a channel selector and 5 controls per channel (Master + Red + Green + Blue = 20 scalar params total).

ParamTypeDefaultDescription
channelenumMasterWhich channel set to display in Properties. Options: Master, Red, Green, Blue.

Master Channel

ParamTypeDefaultDescription
inBlackscalar0.0Input black point. Values at or below this become output black.
inWhitescalar1.0Input white point. Values at or above this become output white.
gammascalar1.0Midtone gamma. Values < 1 darken midtones, > 1 brighten them.
outBlackscalar0.0Output black point. Remapped minimum brightness.
outWhitescalar1.0Output white point. Remapped maximum brightness.

Per-Channel (Red, Green, Blue)

Each channel has the same 5 controls, prefixed by the channel name:

ParamTypeDefaultDescription
redInBlack / greenInBlack / blueInBlackscalar0.0Per-channel input black point
redInWhite / greenInWhite / blueInWhitescalar1.0Per-channel input white point
redGamma / greenGamma / blueGammascalar1.0Per-channel midtone gamma
redOutBlack / greenOutBlack / blueOutBlackscalar0.0Per-channel output black point
redOutWhite / greenOutWhite / blueOutWhitescalar1.0Per-channel output white point

All parameters are keyframeable.

How It Works

The GPU shader processes each pixel through two stages. First, the master levels remap the overall brightness: input values are clamped to [inBlack, inWhite], normalized to [0, 1], gamma-corrected, then scaled to [outBlack, outWhite]. Then per-channel levels apply the same process independently to R, G, and B.

The processing order is: unpremultiply alpha, apply master levels, apply per-channel levels, repremultiply alpha.

Histogram

The Properties panel shows a live histogram of the input image. The histogram is computed from a blitted-down version of the input texture and displays R, G, B, and Luminance distributions on a log scale. The histogram is cached and only recomputed when the input changes (not during playback, for performance).

Usage Examples

Basic: Increase contrast

  1. Add a Levels node after your image source
  2. Set inBlack to 0.1 and inWhite to 0.9
  3. This crushes the shadows and highlights, increasing overall contrast

Creative: Color tinting via per-channel levels

  1. Switch to the Red channel and raise outBlack to 0.1
  2. This adds a red tint to the shadows
  3. Switch to Blue and lower outWhite to 0.8 for warm shadows with cool highlights

Advanced: Animated exposure correction

Keyframe gamma from 0.5 to 1.5 to animate a brightness shift over time. Unlike exposure (which is a linear multiply), gamma reshapes the midtones while preserving blacks and whites.

Tips

  • Use the histogram to identify clipped highlights or crushed shadows before adjusting
  • The gamma slider is the most useful single control -- it adjusts brightness without affecting the extremes
  • inBlack > inWhite inverts the tonal range (negative effect)
  • Per-channel adjustments are applied after master, so they refine the overall adjustment
  • All 20 params are keyframeable, enabling animated color grading
  • Curves -- more flexible per-channel tone control with arbitrary curves
  • ColorCorrect -- CDL-style grading (exposure, saturation, temperature)
  • Invert -- full channel inversion