Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects sampleImage returns inaccurate result?

  • sampleImage returns inaccurate result?

    Posted by Jeremy Paul on August 20, 2017 at 9:05 pm

    I’m playing around and stumbled upon this tutorial that uses greyness of a pixel to determine scale: https://www.youtube.com/watch?v=4OQN2mHQuD0

    To get R value of a pixel it uses sampleImage() method. It samples the central point of a layer. I found it strange that even though the central point is still 100% black, scaling of a shape layer already occurred. Check this image at

    t=9m26s

    for example.

    The expression in question:

    sampleSize = [1,1];
    samplePoint = thisComp.layer(“Control Layer”).transform.position; // it is [960,540]
    sampleColor = thisComp.layer(“Control Layer”).sampleImage(sampleSize,samplePoint)[0];

    [sampleColor*100,sampleColor*100];

    What am I missing here?

    Some contents or functionalities here are not available due to your cookie preferences!

    This happens because the functionality/content marked as “Google Youtube” uses cookies that you choosed to keep disabled. In order to view this content or use this functionality, please enable cookies: click here to open your cookie preferences.

    Leopoldo Perizzolo replied 8 years, 8 months ago 2 Members · 1 Reply
  • 1 Reply
  • Leopoldo Perizzolo

    August 26, 2017 at 2:57 pm

    You simply switched the two arguments of the expression in sampleImage (just like the video did..)
    It should be:

    sampleImage(position, radius), and in your case:

    sampleColor = thisComp.layer(“Control Layer”).sampleImage(samplePoint, sampleSize)[0];

    Hope it’s all clear.

    Leopy

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