Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects How can I “Subtract” channels

  • How can I “Subtract” channels

    Posted by __peter__ on June 13, 2007 at 5:44 pm

    Hello 🙂

    still on my fight with calculations in Aftereffects I wonder:

    How can I subtract 2 chanels. Lets say green minus red.
    There is “add” but no “subtract”.
    Is it really the same to add the inverted chanel, what I thought could be a workaround ?

    But it’s so simple. There must be a subtract possibility.

    And still:
    Can math operations (for chanels) be done in the scripting language ?

    Thanks again!

    _Peter_

    Ben Rollason replied 16 years, 9 months ago 4 Members · 5 Replies
  • 5 Replies
  • Anthony Dupsta

    June 14, 2007 at 1:58 am

    NOt sure what you want to do so I should not reply, but hope this can help you out!

    Effects / Channel / set channel. Set them all to green or whatever channel you need.

    Once you get your layer to act as the green channel you can multiply it in.

    Again sorry if this in not to helpful!

  • Peter O’connell

    June 14, 2007 at 4:00 am

    Subtract is called difference in AE.

    Pete O’Connell
    http://www.barxseven.com

  • __Peter__ Create COW Profile Image

    __peter__

    June 14, 2007 at 6:25 pm

    That easy 🙂

    Thanks!

    _PEter_

  • __Peter__ Create COW Profile Image

    __peter__

    June 14, 2007 at 6:25 pm

    That easy 🙂

    Thanks!

    _Peter_

  • Ben Rollason

    July 23, 2009 at 3:09 pm

    Difference isn’t quite subtract. it’s an absolute subtract. i.e. it only gives positive values. if you subtract white from black, it should give negative 255, or 0 if clipped. Difference doesn’t do this – it gives the absolute value of negative 255 – i.e. 255 or white.

    So white subtract black is white, whereas black subtract white is black (or -255 super black if you’re working in floating point). If we were using difference, they’re both white.

    Here’s a workaround to get a true subtract:-

    ******** thisLayer subtract layer X ********

    effect: Compound Arithmetic
    (set second source layer to layer X; set Operator to Subtract; set Operate on Channels to RGB; set Overflow Behavior to Clip; set Blend with Original to 0%)

    You must make sure that the layer you are subtracting has a solid alpha channel – subtract does not observe alpha, but uses the pre-divided RGB values. If this second layer has an alpha, use a Channel -> Solid Composite over black effect, then precompose before applying the Compound arithmetic to the first layer.
    ______________________________________

    ******** thisLayer subtracted from layer X ********

    effect1: Compound Arithmetic
    (set second source to the layer you are subtracting this one from; set Operator to Copy, Channels to RGB, Overflow Behavior to Clip, Blend with original to 0)

    effect2: Compound Arithmetic
    (set second source to this layer, set operator to subtract, set channels to RGB, set overflow behavior to clip and blend to 0)

    ______________________________________

    As above: You must make sure that the layer you are subtracting has a solid alpha channel – subtract does not observe alpha, but uses the pre-divided RGB values. If this second layer has an alpha, use a Channel -> Solid Composite over black effect, then precompose before applying the Compound arithmetic to the first layer.

    For all of these, do what you like with Stretch second layer to fit, but I prefer to have both layers the same size in the first place!

    http://www.benrollason.com

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