Creative Communities of the World Forums

The peer to peer support community for media production professionals.

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

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

    Posted by Ivan Zornic on December 11, 2016 at 8:58 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

    Ivan Zornic replied 9 years, 5 months ago 2 Members · 4 Replies
  • 4 Replies
  • Walter Soyka

    December 11, 2016 at 10:40 pm

    Check out the use of sampleImage() in expressions. Here’s an example:
    https://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   |   RenderBreak [blog]   |   Profile [LinkedIn]

  • Ivan Zornic

    December 12, 2016 at 5:35 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?

  • Walter Soyka

    December 12, 2016 at 5:48 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   |   RenderBreak [blog]   |   Profile [LinkedIn]

  • Ivan Zornic

    December 12, 2016 at 6:13 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.

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