Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects The math behind blending modes

  • The math behind blending modes

    Posted by Chris Mellor on February 21, 2013 at 10:38 pm

    So I have been trying to figure out exactly what’s going on when changing the blending modes between layers. To do this, I am looking at the RGBA data (set to Decimal in 32bpc) in the Info window while moving my mouse about the canvas.

    So far, my theories were correct as to how “Multiply” and “Add” get their name… but I came across a much more fundamental question. Rather mindblowing in its simplicity.

    How is AE calculating the opacities of two overlapped images?

    The example I have been working with is simple: two solids with Opacity=50% overlap to create an overall opacity of 75% (.75 floating point).
    I am not understanding the equation of .5 + .5 = .75
    Furthermore, it seems .3 + .3 = .51, .75 + .75 = .9375 etc etc.

    I’m just curious what the math is behind this calculation.

    -Chris

    Darby Edelen replied 13 years, 5 months ago 4 Members · 4 Replies
  • 4 Replies
  • Vishesh Arora

    February 21, 2013 at 11:44 pm

    Chris

    I am not understanding the equation of .5 + .5 = .75

    This is related to Zeno’s Paradox. You can read about it from here:

    A lead developer on the After Effects team once described the program’s opacity calculations as follows: Imagine you have a light which is 1, and place a 50% transparent filter (say, a sheet of vellum) in front of it. Half the total light is permitted through the vellum (0.5 * 1 = 0.5). Put another 50% transparent sheet of vellum on top of that. Now half of half the light shows through (0.5 * 0.5 = 0.25). You can theoretically repeat ad infinitum without reaching 0% light transmission, at least in a pure digital environment.

    For more info check this.

    Vishesh Arora
    3D and Motion Graphics Artist
    Films Rajendra

    Blog:
    https://digieffects.wordpress.com

    2011 3D Demo Reel:
    https://www.youtube.com/watch?v=lHPgIJU_BR8

  • Todd Kopriva

    February 22, 2013 at 12:51 am

    See my answer to your question here:
    https://forums.adobe.com/message/5092658

    ———————————————————————————————————
    Todd Kopriva, Adobe Systems Incorporated
    After Effects quality engineering
    After Effects team blog
    ———————————————————————————————————

  • Chris Mellor

    February 22, 2013 at 1:43 am

    Definitely needed to take a step back and think that through logically. Thanks for the help, everyone!

    -Chris

  • Darby Edelen

    February 23, 2013 at 1:19 am

    The Normal blend mode is a standard alpha blend. The reason the colors don’t quite make sense in a simple mathematical relationship is because you’re not considering the alpha values.

    If you assume ‘A’ is the top layer, ‘B’ is the lower layer and their alphas are ‘a’ and ‘b’ respectively then the resulting color is:

    A*a + B*b*(1-a)

    Opacity modifies the alpha of the layer.

    Darby Edelen

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