I am trying to creat a green screen filter. I would like to have the option of passing it a background image, but if no image was passed, then to just make the background transparent. How would I go about checking if a background image was passed to the input?

enter image description here


By default an image texture with no associated file will output a completely black value. You can use this to drive the alpha value of your background, using a "Math" node set to "Greater Than 0" in order to have full transparency when there is no image texture and zero transparency when there is an associated image texture.

  • $\begingroup$ if the background image has black in it though, then it will end up transparent though wouldn't it? $\endgroup$
    – ToMakPo
    Jan 15 '20 at 1:18
  • $\begingroup$ Yes indeed ! You could however tweak your background image to be not completely black, having a color like (R(001),G(000),B(000)) It will still appear as black but your node network will consider the value is in fact greater than 0 $\endgroup$
    – Gorgious
    Jan 15 '20 at 8:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.