How to make a black and transparent PNG shimmer red and only visible when another layer passes over?

I have a fingerprint PNG on my circuit board and I want to be invisible except as the glass of the magnifying glass passes over it. Can I link a mask (on the fingerprint layer) to the motion of the magnifying glass?

I'd also like the fingerprint to be a shimmery red and I figure I can use fractal noise or the heat distortion effect as a source of the shimmer but I don't really know. Can I restrict the grade layer to just the black parts of the PNG? I can change the PNG to red and apply the heat distortion and that looks okayish.



  • If you haven't already create a circle mask filling the magnifying glass (this will need to be an embedded comp shot unless you want to make the circle as a PNG) and parent it up. Drop a Set Matte effect on the Fingerprint, and use the circle mask as the source layer, set the mask type to Alpha and the blend mode to Replace.

  • edited September 2017

    Thanks! When I make the circle mask filling the magnifying glass (the mask is on the fingerprint right?) do I transfer the mask into the composite or leave the mask where it is?

    I think I'm going wrong somewhere.

  • The circle mask needs to be on a solid plane in a separate composite shot.  Parent that circle comp so that it follows the magnifying glass, but hide it so it's not seen.  Then you use that circle comp as the target for the Set Matte effect.

  • I'm really looking forward to seeing this video when it's finished. :)

  • Thanks; that seems to mostly work but the background of the plane I use for the Set Matte source becomes colour of the background of the fingerprint. I don't think I can make the plane colour transparent, right? If I zero the opacity, the fingerprint disappears altogether.

  • Sorry.  Forgot a couple steps.  The black you're seeing around the fingerprint isn't from the Set Matte source. It's the background of the fingerprint layer being forced to be visible by Set Matte (due to the Replace setting).  To fix this, you need to change the Set Matte blend mode to Subtract, then click the Invert check box.  This should leave only the fingerprint with its own alpha intact.

  • Oh, bah, right... the "Replace" mode of the set matte effect overrides existing transparency! d'oh!

    Hmmmm... You could try setting the blend of the fingerprint layer to ADD--this would knock out the black, but would also change the apparent color of the fingerprint...

    Ok, this is inelegant, but it's what immediately comes to mind. Drag in an existing plane from your media bin, position it over the fingerprint, and add another set matte ABOVE the one for the glass. Have this set matte use the plane as the source, and set the blend mode to SUBTRACT. This should hide the print.

    Now change the set matte on the glass so it's blend mode is ADD.

    So it's a two-step process--the first set matte on the layer hides the print, the second should reveal it while respecting the original transparency.


  • In my test, all I needed was a single Set Matte effect to reveal the "print" (a bunch of horizontal lines in my test) when the circle matte moved over it.

  • Changing the Set Matte blend mode to Subtract and then inverting achieved the desired result. I have no idea what is actually happening but it works!

  • Ah, good--glad you found an easier way.

  • @THX1139 Here's my understanding of how that works.  Setting the Set Matte blend mode to Subtract (using the default Alpha option) takes the alpha values of your matte source (the circle) and subtracts them from your layer's own alpha values.  Areas that are opaque (visible) where your matte source (circle) overlaps your own layer (fingerprint) will become fully transparent.  (The underlying alpha values actually go from 0-255, but I'll use percentages to keep things simple): 

      100% opaque fingerprint
    - 100% opaque matte
    = 0% opaque final

    The transparent areas around the circle leave the original fingerprint fully visible:

      100% opaque fingerprint
    - 0% opaque matte
    = 100% opaque final

    For areas outside the circle where your fingerprint alpha is already transparent (0% opaque), it's just a simple 0 - 0 = 0 calculation, leaving those alpha values unchanged.

    The Invert option then tells it to invert the alpha values of the matte before doing the math, so that the surrounding transparent pixels now fully remove the fingerprint, and the opaque pixels inside the circle leave it visible.

  •  @THX1139 The Subtract mode of the Set Matte effect is simply doing math between your matte source's alpha values and those of the layer where the effect is applied.  While the underlying alpha values range between 0 and 255, I'll use percentages in some quick examples to (I hope) make this easier to understand.

    When you first set the target for Set Matte to use your circle layer, and change its blend mode to Subtract, it's taking the original alpha of your fingerprint, subtracting the alpha of the matte, and applying the result back on your fingerprint.  So where your 100% opaque fingerprint overlaps the 100% opaque circle, we get 100-100=0, so those parts of your fingerprint now have a 0% opaque alpha value.  Outside the circle where the matte is 0% opaque the same math is happening, but it's leaving the fingerprint's alpha untouched because it's subtracting 0 from everything.

    When you check the Invert box, it inverts the matte alpha before doing all of the above math, so areas where the matte was hiding things now become visible, and those that were visible now are hidden.

    The reason that it leaves your fingerprint's transparent parts alone is because alpha values can't go below zero.  So wherever an opaque part of the matte overlaps a transparent part of your original fingerprint, and the calculation is effectively 0% - 100%, it just leaves it at 0.

Sign in to comment