Expression Color sample question

Hi there. Probably a question for Sinan but any other help would be very much appreciated. :wink:
Is there a way, with an expression to sample luminosity of an image and get the rgb or YUV values?
The idea would be to link another value like blur, transparency, position or whatever to the rgb values…
I’m sure it can be done but I’m clearly not that smart… :frowning: Thx

You can write an expression that is based on the value of a pixel but there is no way to sample the image within an expression. I believe Mark Doney wrote some matchboxes that sampled the pixels.

1 Like

I did a demonstration of this many many years ago, before Matchbox was a thing, utilizing some expressions in combination with a Sapphire spark, and an Action. It was nasty ugly, but worked. I remember someone showing a modern good solution since, but I forget.


the value of a pixel would be super nice already!

I once had to do a similar thing. Very clunky and not interactive but worked for me:

  • Blur or scale your image to get an average color
  • Add a frame of white to action and rotate it 90 degrees on the x axis
  • Feed your average color as a displacement map to this surface and displace in z
  • Your frame of white is going to act like digital vu-meter when seem from the side
  • Track the top of the displaced surface and link it to your value

Time for the annual curve tool from Nuke request. Almost exactly a year ago…

1 Like

This is the way

This is the way. LS_Chips is almost there.

If you want to hit it with a hammer, take the image you want to sample the pixels from, put the axis.centre on the pixel you want to sample, blow it up 5000% with filtering set to nearest, then step through frame by frame and sample the colour in surface>material>specular for every frame. You will then have a keyframed sequence of numbers to base an expression on.

Wow. Thank you @ytf .

@lewis This would totally make it work if you could also provide linkable values for RGB, as well as displaying them as text. Pretty please :blush:

1 Like