How to find the brightest or the darkest frame
of an entire sequence

Sometimes you need to work out how luminance changes through a sequence and which frame is the brightest to synchronize your animation or color correction with the footage. It's especially useful if there are explosions, flashes or lightnings in the sequence or it's a time-lapse.
If you also find the darkest frame in the sequence, the measured data can be used for deflickering. Another purpose is checking whether any unwanted black or white clipping has occurred.

To find the brightest or darkest frame in an image sequence,

  1. Create a Background
  2. RMB on it's Red control, select Modify With › Probe
  3. Go to the Modifiers tab, drag'n'drop your loader to the Image to Probe field
  4. Check Probe Rectangle, set Width = 1, Height = 1, select Luma as the channel.
  5. See the Spline view for Background › Top Left Red
You can then RMB on the Background node, select Script › Bake Animation to prevent the Probe from recurring expensive calculations.
This curve in Spline can be used to determine the brightest or darkest frame and to see the luminance dynamics.
Animation can be connected to it or synchronized with it by eye.
In this example only luminance was measured. You can measure Red, Green, Blue separately assigning separate Probes to corresponding channels of the Background and selecting Red, Green and Blue in the Probes.

If you need to integrate an object into a BG plate with variable brightness or you want to perform a complicated luminance-based color correction on it,

  1. Create a Dissolve node, go to the Common Control tab (radiation), RMB on the Blend, select Modify With › Expression
  2. In the Expression controls, RMB on the Number in 1, select Modify With › Probe
  3. Go to the Probe controls, drag and drop the BG plate to Image to Probe, Set the Channel to Luma, check the Probe Rectangle, set the Width and Height to 1.
  4. Select the Expression modifier, RMB on its header, run Script › Bake Animation for Number in 1
  5. Go to the Spline view, remove the top part of the Number in 1 spline, press Ctrl+F. Locate the lowest value, copy the value to the clipboard undo the deletion of points. Remember the frame number with the lowest value.
  6. In the Number Out expression type n1- paste the value from the clipboard right after the minus sign.
  7. Go to the Spline view, remove the bottom part of the Number in 1 spline, press Ctrl+F. Locate the highest value, go to the frame with the highest value. Remember the frame number.
  8. Check the current (the highest) value of the Blend parameter of the Dissolve, copy it to the clipboard.
  9. Go back to the Number Out expression, enclose everything you had there so far into brackets, enter / afterwards and paste the value from the clipboard right after the division sign. The expression should look like this: (n1-X)/Y, where X is the darkest value of the probe spline and Y is the value of n1-X in the frame with the brightest probe value.
  10. Create two separate setups for the brightest and the darkest frames, feed the darkest into the BG input of the Dissolve and brightest into the FG input.

If you want to find the brightest and darkest color values in the whole sequence regardless of frame number,
use the Trails tool set to the Lighten or Darken modes in conjunction with the Probe:
Insert the Trails right after the Loader with the sequence, switch to the desired mode, render the whole sequence - you will get an image with the highest or lowest color values in the last frame. It can be useful for color normalization too, or for finding the bounding box of a position pass.


© 25.11.2009 - 31.01.2015 Gregory Chalenko