Green Screen Auto Levels Expression

Scripting for After Effects

Green Screen Auto Levels Expression

Postby Timber_Wolf_2 on 04/30/2017, 10:24 pm

I'm doing some Green Screen work for someone who used auto exposure when shooting. It's not terrible, but it's not awesome, as you can imagine.

Is there an expression that can sample a region of pixels and return an numerical value for its average luminance (I assume between 0 and 255)?

My thinking is, if I can use frame 1 as my master brightness level, then every frame after that will have a definite numerical value that is determined by how much brighter or darker it is from frame 1. I could then use that number to drive an exposure effect.

I could create a perfect auto-levels effect using expressions!

So... can it be done?

Carpe diem pro nomine Christi
Posts: 925
Joined: 10/11/2011, 11:23 am
Location: Pensacola, FL

Re: Green Screen Auto Levels Expression

Postby Michael_Szalapski on 06/1/2017, 12:52 pm

I mean, there's sampleImage(). Resource here.
Michael Szalapski
Fast. Cheap. Good.
Pick two.
Posts: 8245
Joined: 02/2/2010, 1:06 pm
Location: Nashville, TN, USA
Twitter: thegreatszalam

Return to After Effects Expressions