ANR Tools

ANR Adaptive Grade Matcher

Moves a comped element's blacks onto the plate's, its whites too if you want, and keeps them there when the plate drifts with exposure, flicker or haze.

  • Comp
  • Comp & Depth pack
  • 3 inputs
  • 20 controls

Overview

Adaptive Grade Matcher moves the Foreground's black point onto the Background's. The black point is the level of the darkest few pixels of an image (Black Pick percent). The node adds the difference, Background black minus Foreground black, to the whole Foreground: one offset per channel, scaled by the Foreground's alpha, so soft edges get their share and nothing outside the element changes.

Tick Match Highlights to match the white point as well, a levels match: the darkest and the brightest of the Foreground land on the Background's, and the range between them is stretched or squeezed to fit. The white point is the level of the brightest few pixels (White Pick percent).

In Live mode the levels are measured on every frame, so the element follows a plate that drifts: an exposure change, a flicker, haze rolling in. In Picked mode the node uses fixed values, set by a Pick button on the frame you are on, or typed in.

Because it changes one value per channel (two with Match Highlights) rather than each pixel, no tracking is needed and the element's own detail stays as it is. With Match Highlights off only its floor moves, and its contrast is kept. Use it for haze, flare, a lifted black level, a CG render whose shadows are cleaner than the plate's, or highlights that sit brighter or duller than the plate's.

Inputs

ForegroundBackgroundMaskAdaptive Grade MatcherOutput
  1. Foregroundrequired

    The element to match (a CG render, a patch, a keyed element), already placed over the plate. Its levels are measured where its alpha is above one half; an image without alpha counts everywhere.

  2. Backgroundrequired

    The plate the element sits on. Its black point (and white point, with Match Highlights) is the target, measured over the whole frame or only behind the Foreground (Background Region).

  3. Maskoptional

    Limits where the correction is applied. Invert Mask applies it outside the mask instead.

Output. The Foreground with its levels moved and its alpha unchanged, ready to merge over the plate. Output > Offset shows the offset itself as a flat colour instead.

Quick start

  1. Place and grade your element over the plate as usual.
  2. Add ANR Adaptive Grade Matcher. Connect the element to Foreground and the plate to Background.
  3. Leave Mode on Live: on every frame the element's darkest level now sits on the plate's.
  4. To match the highlights too, tick Match Highlights: the element's brightest level then sits on the plate's as well.
  5. If the plate's darkest areas are far from the element (letterbox bars, a deep shadow on the other side of frame), set Background Region to Behind Foreground.
  6. If grain makes the result flicker, raise Live Smoothing to average the measurement over a few frames either side.
  7. For a fixed correction instead, go to a good frame and press Pick Blacks: Whole Background or Pick Blacks: Behind Foreground, and Pick Highlights: Whole Background or Pick Highlights: Behind Foreground for the whites. The node keeps the values and switches to Picked.
  8. Merge the result over the plate as before.

The panel

The node's panel as Nuke shows it, with the values of a new node. Click any control to see what it does; tabs and sections work as in Nuke.

ANR_Adaptive_Grade_Matcher1
StatusLive: both black points measured on every frame, the Background's over the whole frame.
ModeLive
Background RegionWhole Background
Black Pick0.5
Live Smoothing0
Pick Blacks: Whole Background
Pick Blacks: Behind Foreground
Foreground Black0
Background Black0
ChannelsRGB
Strength1
OutputResult
Invert Mask
Mix1
Match Highlights
White Pick0.5
Pick Highlights: Whole Background
Pick Highlights: Behind Foreground
Foreground White1
Background White1

All controls

ANR Adaptive Grade Matcher20 controls
StatusStatusstatus

What the node is doing, and what a Pick button found.

ModeMenubmMode

Live: measure both black points on every frame, so the Foreground follows a Background whose blacks drift (exposure, flicker, haze).
Picked: use the Foreground Black and Background Black below, set by a Pick button or typed.

Default: LiveOptions: Live Picked

Background RegionMenubmRegion

Where the Background's black point is measured: over the whole frame, or only where the Foreground is (its alpha).

Default: Whole BackgroundOptions: Whole Background Behind Foreground

Black PickSliderbmBlackPick

The black point is the level of the darkest this percent of pixels. 0 is the single darkest (a 2x2 average), which grain makes unreliable.

Default: 0.5

Live SmoothingSliderbmSmoothing

Live: average the measurement over this many frames either side, so grain does not make the blacks flicker. 0 is this frame only.

Default: 0

Pick Blacks: Whole BackgroundButtonbmPickWhole

On the frame you are on: measure the Foreground's black point and the whole Background's, keep them below, and switch to Picked.

Pick Blacks: Behind ForegroundButtonbmPickBehind

On the frame you are on: measure the Foreground's black point and the Background's where the Foreground is, keep them below, and switch to Picked.

Foreground BlackColourbmForegroundBlack

Picked: the Foreground's black point.

Default: 0

Background BlackColourbmBackgroundBlack

Picked: the Background's black point.

Default: 0

ChannelsMenubmChannels

RGB: each channel's black point matched, so a colour cast in the blacks carries across.
Luminance: one offset for all three channels.

Default: RGBOptions: RGB Luminance

StrengthSliderbmStrength

How much of the offset to apply.

Default: 1

OutputMenubmOutput

Result: the Foreground with its blacks moved.
Offset: the offset itself, as a flat colour.

Default: ResultOptions: Result Offset

Invert MaskCheckboxbmInvertMask

Apply outside the Mask instead.

Default: off

MixSliderbmMix

Blend the result over the unchanged Foreground.

Default: 1

Match HighlightsCheckboxbmMatchHighlights

Also move the Foreground's white point onto the Background's (a levels match): the darkest and the brightest of the Foreground land on the Background's. Live measures both; the Pick Highlights buttons pick the whites (and tick this). A white point clipped at the top of an 8/16-bit input is not matched.

Default: off

White PickSliderbmWhitePick

The white point is the level of the brightest this percent of pixels (a 2x2 average). Raise it if a few specular glints set it.

Default: 0.5

Pick Highlights: Whole BackgroundButtonbmPickWhiteWhole

On the frame you are on: measure the Foreground's white point and the whole Background's, keep them below, tick Match Highlights and switch to Picked (from Live the blacks are kept from this frame too).

Pick Highlights: Behind ForegroundButtonbmPickWhiteBehind

On the frame you are on: measure the Foreground's white point and the Background's where the Foreground is, keep them below, tick Match Highlights and switch to Picked (from Live the blacks are kept from this frame too).

Foreground WhiteColourbmForegroundWhite

Picked: the Foreground's white point.

Default: 1

Background WhiteColourbmBackgroundWhite

Picked: the Background's white point.

Default: 1

Tips

  • Set Output to Offset to see the correction alone, as a flat colour.
  • Channels > RGB matches each channel, so a tinted haze in the plate's blacks carries over to the element. Luminance applies one offset (and, with Match Highlights, one gain) to all three channels, which keeps the element's own colour balance.
  • Raise Black Pick when a few stray dark pixels decide the black point. At 0 the single darkest spot decides, which grain makes unreliable. Raise White Pick when a few specular glints decide the white point.
  • Strength scales the correction, the stretch of Match Highlights included (above 1 it overshoots); Mix blends the result with the untouched Foreground.
  • A Pick Highlights button ticks Match Highlights for you. Pressed in Live, a Pick button also keeps that frame's other pair (the whites only while Match Highlights is on), so Picked starts from what Live showed; in Picked, each button replaces only its own pair.
  • After a Pick, Status shows the levels found and the frame they came from.
  • In Picked mode you can type Foreground Black, Background Black, Foreground White and Background White yourself, or key them.

Good to know

  • Whole Background measures everything in the frame: letterbox bars or a black border become the plate's black point, and a bright lamp or sky can become its white point. Use Behind Foreground for such plates, or crop the bars off the Background input.
  • In Live mode, a frame where the Foreground's alpha is nowhere above one half has nothing to measure and gets no correction. For an element that fades in or dissolves, use Picked.
  • With Match Highlights in Live, a white point at the very top of an 8-bit or 16-bit input is clipped and is not matched: that channel gets the blacks match only. A Pick Highlights button warns of it in Status.
  • With Match Highlights on, Output > Offset shows only the offset part of the correction, not the stretch.
  • Live Smoothing measures that many frames on each side for every frame it renders, so high values are slower.

Something unclear or missing? Write to [email protected].