Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects How to calculate shape area?

  • Peter Diefenthaler

    June 6, 2015 at 7:47 pm

    I figured something like this out a while back, maybe it will help.

    Precompose the layer you want to calculate the area for and make sure the background is transparent. On the precomposed layer, add a slider expression control, alt click the slider and apply this expression:

    sampleArea = [thisComp.width,thisComp.height]; // Specifies the comp frame dimensions
    color = sampleImage(sampleArea*0.5,sampleArea); // Samples the colors of entire frame area

    100*(color[3]*4) // Returns the percentage of Alpha within the frame

    Note: You should be in 16 or 32bpc for this to be accurate and I don’t think multiprocessing will work with the “sampleImage” expression.

    I hope this was helpful. Good luck.

    Peter Diefenthaler
    https://www.ideafirecreative.com/

  • Andrew Shishkin

    June 7, 2015 at 5:50 pm

    Peter, that is awesome! Exactly what I searched. Thank you so much!

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