Skip to main content
patrickb55135943
Participant
October 17, 2019
Answered

How to match color to a color that changes dynamically in the footage?

  • October 17, 2019
  • 1 reply
  • 1028 views

Hello,

    I have a fire effect.  I want to light the surrounding area to match the fire color as it burns/flickers. How can I do this please?  Is there a way to pick a point on the footage and tint the surrounding area to match as the color changes?

    This topic has been closed for replies.
    Correct answer Rick Gerard

    To give you the most efficient solution we need a screenshot. This can be done in a number of ways. It all depends on what technique you are using to simulate the light from the fire. I can think of about 20 different approaches. It would also be helpful to know a little about your comfort level with After Effects. I would point a very experienced user to a different solution than someone just starting out.

     

    One solution would be to use a null to pick a spot in the comp to sample the color, set the radius of the sample, then use that to drive the color of another layer, light, or effect that you are using to simulate the firelight. An expression something like this would be applied to the Color property of the effect you were using to generate the simulated firelight:

     

    point = thisComp.layer("Sample Color Null").position;
    lyr = thisComp.layer("Original Footage");
    lyr.sampleImage(point, radius = [10, 10], postEffect = true, t = time)

     

    • point is the position of the null that you put over the part of  the fire that you want to use to control color
    • lyr is the footage or fire effect layer that you are trying to sample
    • radius is the radius of the circle that is taking the sample - the value is averaged and the larger the radius the longer it takes to render

     

    This expression can only be applied to a color property that shows up in the timeline as a solid color like the fill of a shape layer or the A color in Glow.

     

    Another really easy solution is to just duplicate your fire layer, apply a bunch of blur to the layer, set the blend mode to something like screen and adjust the opacity. That solution would take just a few seconds. 

     

    Show us the comp and describe your workflow in detail so we can give you the most efficient solution. One solution will take a couple of minutes, another could take a couple of days.

    1 reply

    Rick GerardCommunity ExpertCorrect answer
    Community Expert
    October 17, 2019

    To give you the most efficient solution we need a screenshot. This can be done in a number of ways. It all depends on what technique you are using to simulate the light from the fire. I can think of about 20 different approaches. It would also be helpful to know a little about your comfort level with After Effects. I would point a very experienced user to a different solution than someone just starting out.

     

    One solution would be to use a null to pick a spot in the comp to sample the color, set the radius of the sample, then use that to drive the color of another layer, light, or effect that you are using to simulate the firelight. An expression something like this would be applied to the Color property of the effect you were using to generate the simulated firelight:

     

    point = thisComp.layer("Sample Color Null").position;
    lyr = thisComp.layer("Original Footage");
    lyr.sampleImage(point, radius = [10, 10], postEffect = true, t = time)

     

    • point is the position of the null that you put over the part of  the fire that you want to use to control color
    • lyr is the footage or fire effect layer that you are trying to sample
    • radius is the radius of the circle that is taking the sample - the value is averaged and the larger the radius the longer it takes to render

     

    This expression can only be applied to a color property that shows up in the timeline as a solid color like the fill of a shape layer or the A color in Glow.

     

    Another really easy solution is to just duplicate your fire layer, apply a bunch of blur to the layer, set the blend mode to something like screen and adjust the opacity. That solution would take just a few seconds. 

     

    Show us the comp and describe your workflow in detail so we can give you the most efficient solution. One solution will take a couple of minutes, another could take a couple of days.

    patrickb55135943
    Participant
    October 19, 2019

    Thank you Mr. Gerard!  That worked perfectly.  I actually used both methods together(Blur layer method and the Null point sample to drive the tint of another layer method).   Thanks again for the code, just what I was looking for.