ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

How I can calculate average RGB of an part of Image in After Effects?

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Ivan Zornic
How I can calculate average RGB of an part of Image in After Effects?
on Dec 11, 2016 at 8:58:02 pm

Is there a way to calculate average RGB value for an part of image? Can this be done in script?

I need something like Color Link effect but only for a part of image. When I use mask, effect shows average RGB from whole image.

My goal is to divide image in parts and get average RGB value for each part. Is this possible?

Thanks in advance,
Ivan


Return to posts index

Walter Soyka
Re: How I can calculate average RGB of an part of Image in After Effects?
on Dec 11, 2016 at 10:40:22 pm

Check out the use of sampleImage() in expressions. Here's an example:
http://www.motionscript.com/design-guide/obscuration.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

Ivan Zornic
Re: How I can calculate average RGB of an part of Image in After Effects?
on Dec 12, 2016 at 5:35:53 pm

sampleImage() is what I'm looking for, but I can't call this function from script file???

Is there any way to do that?


Return to posts index


Walter Soyka
Re: How I can calculate average RGB of an part of Image in After Effects?
on Dec 12, 2016 at 5:48:26 pm

[Ivan Zornic] "sampleImage() is what I'm looking for, but I can't call this function from script file??? Is there any way to do that?"

Sort of. You can use scripting to apply the sampleImage() expression to a property, retrieve and store the result, then delete or reset the sampleImage() expression.

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

Ivan Zornic
Re: How I can calculate average RGB of an part of Image in After Effects?
on Dec 12, 2016 at 6:13:57 pm

Thanks for fast reply.
I'm trying to call this function from script with no result.
There is no error, script just stop on point where sampleImage() is called. Returns nothing and does not execute any code below.

Is there any reference to this function? Where can I see what all 4 parameters are. First two are clear, but other two are not.

Sorry for my ignorance, I am new to all this.


Return to posts index

Dave LaRonde
Re: How I can calculate average RGB of an part of Image in After Effects?
on Dec 12, 2016 at 2:06:07 am

It could be very simple. It depends on what you're doing. In a different composition, apply the mosaic effect to your footage. It will automatically average the color values in a given area. This may be all you need.

Dave LaRonde
Promotion Producer
KGAN (CBS) & KFXA (Fox) Cedar Rapids, IA


Return to posts index

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