Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions RGB Calculations – my last try

  • RGB Calculations – my last try

    Posted by __peter__ on December 8, 2007 at 8:44 pm

    Hello 🙂

    I asked this questions so many times in so many forums, so you are my last hope.

    Is there a way of doing mathematical operations with RGB chanels between layers.

    Something like:

    Divide the RGB Values of Layer 1 by RGB Values of Layer 2
    Simply that.

    If at all possible, how would such a expression be ?

    Thanks for every help or idea.

    Peter

    Darby Edelen replied 18 years, 5 months ago 4 Members · 4 Replies
  • 4 Replies
  • Filip Vandueren

    December 8, 2007 at 11:06 pm

    Hi Peter,

    I think dividing is a bad example…
    What would you expect of white divided by 25% gray? 400% superwhite?
    and divided by black…

    Anyway, there’s no way to alter the output of a layer on the pixellevel using expressions.
    There’s the calculations filter that does some basic combinations, but t
    of course there are the layer modes:

    Multiply, add, and classic difference.
    Screen is not divide, although it has the inverse effect of multiply, it’s actually multiplying the negative of the layer’s.

    Again, what output do you expect to see from dividing?
    There might be a workaround,

  • __Peter__ Create COW Profile Image

    __peter__

    December 9, 2007 at 1:00 am

    I am working for a long time now with the great book of Steve Wright.

    And there is that greenscreen correction procedure that obviously needs dividing.
    But I would be happy to know a workaround.

    Thanks!

    Peter

  • Trent Armstrong

    December 10, 2007 at 10:48 pm

    Check this tutorial for AE 8 from Maltaannon.com

    https://maltaannon.com/tutorials/AfterEffects/cePixelSampler/

    Another way to gather the RGB values is to use the imageSample() expression. More information here:

    https://www.motionscript.com/design-guide/sample-image.html

    Trent

  • Darby Edelen

    December 10, 2007 at 11:37 pm

    For those of us that are not familiar with the book you mention, what is the formula you are trying to enact in AE?

    Filip echoes my concern about dividing values… Visible RGB values in AE all fall between 0 and 1. Dividing anything by a number in the range of 0 to 1 will give you a number that is either equal to or larger than itself:

    x / {0...1} = {Infinity...x} *

    Are you sure we’re not talking about multiplication?

    *I have no idea if this is the right way to represent a set of real numbers between 0 and 1… but it looks good to me (;

    Darby Edelen
    Designer
    Left Coast Digital
    Santa Cruz, CA

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