Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Quick Overall Lightness Measurement?

  • Quick Overall Lightness Measurement?

    Posted by Jerry Smith on June 14, 2017 at 10:06 am

    Is there a way to just get the overall lightness of a frame? I don’t know much about lab space or whatever. I just want a rough measure of how much somebody’s pupil opens when I switch from a midnight blue to yellow background. You get the idea. If not in AE, in Pr?

    Jerry Smith replied 8 years, 11 months ago 3 Members · 6 Replies
  • 6 Replies
  • Walter Soyka

    June 14, 2017 at 2:29 pm

    Here’s a rough outline for how to do it.

    In the comp that you want to sample, add an adjustment layer at the top. This is the layer that we’ll sample in order to measure the color of the frame. Using an adjustment layer at the top gives us one layer to look at but see the entire composite of all the layers below it.

    Add a text layer above that. Add the Layer Control effect to the text layer, and then select your adjustment layer with the layer control.

    In the timeline, twirl open the text layer and its text group. Alt+click the stopwatch icon for Source Text, then enter this expression:

    // choose a layer to sample for color
    sampleLayer = effect("Layer Control")("Layer");

    // get the average color of the layer as a whole; we'll sample the point in the center of the layer, with a sampling radius the size of half the width and half the height
    // in other words, we're averaging the color samples for the entire frame into a single value
    color = sampleLayer.sampleImage([sampleLayer.width/2, sampleLayer.height/2], [sampleLayer.width/2, sampleLayer.height/2]);

    // convert that color sample into perceptual brightness, using the "HSP" color model
    // more information here: https://alienryderflex.com/hsp.html
    brightness = Math.sqrt(0.299*color[0]*color[0] + 0.587*color[1]*color[1] + 0.114*color[2]*color[2] );

    This will give you an on-screen readout of the perceived brightness of the frame as a whole, on a scale of 0 to 1.

    For more information on perceptual brightness and the HSP color model I’m using, see here:
    https://alienryderflex.com/hsp.html

    Walter Soyka
    Designer & Mad Scientist at Keen Live [link]
    Motion Graphics, Widescreen Events, Presentation Design, and Consulting
    @keenlive   |   RenderBreak [blog]   |   Profile [LinkedIn]

  • Richard Garabedain

    June 14, 2017 at 2:43 pm

    i just use an adjustment layer with levels on it. it tells me how bright everything is.

  • Walter Soyka

    June 14, 2017 at 2:51 pm

    The latest version of Ae (finally) has scopes, too!

    https://helpx.adobe.com/after-effects/using/color-basics.html#main-pars_header_1319445692

    Walter Soyka
    Designer & Mad Scientist at Keen Live [link]
    Motion Graphics, Widescreen Events, Presentation Design, and Consulting
    @keenlive   |   RenderBreak [blog]   |   Profile [LinkedIn]

  • Jerry Smith

    June 14, 2017 at 4:47 pm

    @ Richard, I’m sorry, I don’t follow. Can you elaborate a bit?

    @ Walter, does the presence of Scopes mean I don’t have to do your first procedure?

    Thanks.

  • Walter Soyka

    June 14, 2017 at 5:16 pm

    [Jerry Smith] “Walter, does the presence of Scopes mean I don’t have to do your first procedure?”

    What I describe at first was what I thought you were most literally looking for — a single number that represents the overall brightness of any given frame. Either the Levels histogram in the Effects Control Panel or Lumetri Scopes will give you a much more nuanced interpretation of your image, and either can be read and understood at a glance.

    Walter Soyka
    Designer & Mad Scientist at Keen Live [link]
    Motion Graphics, Widescreen Events, Presentation Design, and Consulting
    @keenlive   |   RenderBreak [blog]   |   Profile [LinkedIn]

  • Jerry Smith

    June 15, 2017 at 8:01 pm

    Thanks!

    I put that in and it worked great. Thanks so much. You left out the last line though. I had to figure that out on my own. Hehe.

    How different would you say .7 and .8 are? Say I have a yellow that is .8 and I have a brown that is .7 but I want them to be “similar” or “of the same family” or… Would a pro try and tweak them? Consider these titltes here: https://www.eyrolles.com/Accueil/Recherche/?q=a+book+apart&nb=20 Do they try and get the lightness to match?

    Thanks again for all the help.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy