How to create an alpha mask from the difference between 2 sources?

adamribaudo's icon

If I have a picture of a room with a plant coming from one input, and a picture of just the room coming in the other, how would I subtract out the room to just show the plant?

In other words, how do I show the difference between 2 inputs?

I've tried jit.op to subtract one matrix from the other, which works to some degree, but when colors are similar to each other, they get subtracted out to almost nothing. In the perfect solution, I would subtract one matrix from the other, and if the result is over some threshold, show the full opacity of the original image (with the plant).

Rob Ramirez's icon

hi. try searching the forum for "frame difference" and you will get lots of hits.

if you can't figure it out, please post a simplified version of your patch, demonstrating what you are trying to achieve.