Forum Replies Created

  • Rick Gerard

    June 30, 2023 at 7:04 pm in reply to: Pixel value reading to use with other parameters.

    You can use ReferenceLayer.sampleImage(position, radius[10, 10]) to sample the RGBA values of a layer then use rgbToHsl[2] to convert the RGB value to a linear value. You can then set up a linear interpolation method to drive the values in Exposure within the range you want. For example, this expression added to exposure will take the position of the current layer and adjust the exposure value as the luminance of the layer changes under the current layer.

    ref = thisComp.layer(index + 1);

    v = ref.sampleImage(position, radius = [.5, .5], postEffect = true, t = time);

    t = rgbToHsl(v)[2];

    linear(t, .25, .75, -1, 2)

    You might want to replace position in the expression with the position of a null layer so you can easily drag the null over the flickering light. Color values range between zero and one, and exposure values are based on a f-stop (logarithmic scale) so you might have to fiddle with the values.

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