ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Quick Overall Lightness Measurement?

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Jerry Smith
Quick Overall Lightness Measurement?
on Jun 14, 2017 at 10:06:55 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?


Return to posts index

Walter Soyka
Re: Quick Overall Lightness Measurement?
on Jun 14, 2017 at 2:29:41 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: http://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:
http://alienryderflex.com/hsp.html

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


Return to posts index

Richard Garabedain
Re: Quick Overall Lightness Measurement?
on Jun 14, 2017 at 2:43:33 pm

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


Return to posts index


Walter Soyka
Re: Quick Overall Lightness Measurement?
on Jun 14, 2017 at 2:51:18 pm

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

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

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


Return to posts index

Jerry Smith
Re: Quick Overall Lightness Measurement?
on Jun 14, 2017 at 4:47:53 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.


Return to posts index

Walter Soyka
Re: Quick Overall Lightness Measurement?
on Jun 14, 2017 at 5:16:00 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 [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index


Jerry Smith
Re: Quick Overall Lightness Measurement?
on Jun 15, 2017 at 8:01:52 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: http://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.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]