Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions pixel alpha value?

  • pixel alpha value?

    Posted by John Donley on May 21, 2010 at 5:37 pm

    Hi guys,

    I am trying to write a script that will tell me if a comp has any alpha anywhere in it. Ive tried to use the sampleImage() method, but that only works in expressions, not in scripts. To work around that problem I added an adjustment layer, gave that an a slider control. I then gave the slider control an expression testing for alpha using the sampleImage(), and then had a script read that value, but that ran so slowly the script time out.

    After Effects knows exactly what the color value of every pixel is, and it gives it to me in realtime in the info panel. I cant find anyway to tap into that information. Any ideas?

    John Donley replied 16 years, 3 months ago 2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    May 21, 2010 at 6:23 pm

    Does your expression sample the entire area of the comp at once? If so, I can’t think of a better way to do it than what you have now.

    Dan

  • John Donley

    May 21, 2010 at 6:37 pm

    it samples 500 x 1 px across the top, sides and bottom. I have also written a Pixel Bender plugin that scans the image for alpha, and puts a red dot in the corner if it finds any. then I tried to use the sampeImage to see if that pixel is red, but that gave me inconsistent results.

    So, there is no way to check an images color value directly?

  • Dan Ebberts

    May 21, 2010 at 6:44 pm

    Not from a script. What I usually do is have the script temporarily add something to the comp that it can apply the expression to, and then remove it afterward.

    Dan

  • John Donley

    May 21, 2010 at 6:52 pm

    k, thanks.

    John

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