glsl subtract background

Hi all, I was working on glsl to subtract the white background and turn the pixels to transparent.

However the pixels inside the black contour which are white will also be subtracted.

Is there any algorithm I can use to keep the white pixels inside the black contour but turn the background pixels which are also white to transparent?
Thanks in advance!!

Yes try out my flood fill tox:
github.com/DBraun/TouchDesigner … d_fill.tox

Try clicking to select the outside white. It shouldn’t select the black or white inside your drawing. Then composite however necessary.

1 Like

That’s cool. Thanks so much!
I am thinking if there is a way to do it without a feedback top. Any idea?
cuz I am trying to do this effect in unity however failed to find out a function that works like feedback top in unity.