Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Layer Alpha Boundary Size?

  • Layer Alpha Boundary Size?

    Posted by Royce Jacobs on July 15, 2019 at 12:54 am

    So in the Layers panel there’s a button at the bottom to show the Alpha Boundary, and when applied to a transparent image or video, the result will show that the program has determined the layer’s outermost boundaries of opaque data.

    Since AE has been so great to already do this work, can I somehow get this boundary size data? I want to be able to scale a layer (with expressions) so the opaque area fills the comp window regardless of how much “dead” space is outside of it. Thanks for any ideas! ????

    Something like this?

    //on Scale:
    sizeX = 100*thisComp.width/thisLayer.blahblahAlphaBoundary.width;
    sizeY = 100*thisComp.height/thisLayer.blahblahAlphaBoundary.height;
    lesserScale = Math.min(sizeX,sizeY);//only scale to nearest edge, so as not to exceed the comp size
    [lesserScale,lesserScale]//set x & y the same to maintain layer aspect ratio

    //on Scale:
    sizeX = 100*thisComp.width/thisLayer.blahblahAlphaBoundary.width;
    sizeY = 100*thisComp.height/thisLayer.blahblahAlphaBoundary.height;
    lesserScale = Math.min(sizeX,sizeY);//only scale to nearest edge, so as not to exceed the comp size
    [lesserScale,lesserScale]//set x & y the same to maintain layer aspect ratio

    Miguel De mendoza replied 6 years, 9 months ago 2 Members · 1 Reply
  • 1 Reply
  • Miguel De mendoza

    July 15, 2019 at 3:21 pm

    As I can see inspecting scripting layer properties, there is no such property. Maybe you can precomp the matted image and use “sampleImage()” to get alpha values of the precomp. Not trivial, not elegant and not eficient but may work

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