Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Is there an Expression to find position of brightest pixel on a layer?

  • Kalleheikki Kannisto

    May 1, 2019 at 5:41 am

    You would combine two nested loops for x and y coordinate lookup and use sampleImage() for checking the color values and then store the coordinates of the lightest one in a two-dimensional array and apply that to position of the other layer.

    To make life easier, convert the source image to grayscale so you can get the lightness value directly from any channel rather than having to calculate it from the RGB channels (if you have color, that is).

    Kalleheikki Kannisto
    Senior Graphic Designer

  • Mike Potter

    May 2, 2019 at 7:40 am

    I think the expression would be simpler
    if by using effects I manage to have just
    one single maximum brightness pixel (255,255,255) on a completely dark (0,0,0) background.

    How would the expression “sound like” ☺ in this case please ?

  • Kalleheikki Kannisto

    May 2, 2019 at 9:20 am

    If you manage to do that the “expression” would sound like a point tracker 🙂

    Kalleheikki Kannisto
    Senior Graphic Designer

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