Actually -- a Processing example suggests that the shader doesn't need two image inputs. All you really need to do is draw two layers: 1, a background layer, and 2, use the shader to generate alpha on the foreground layer, and draw on top of the background.
That can be done with the work that I did on shaders before.
I had a crack at it, and I'm afraid I got only as far as not crashing. This is probably because I don't understand the math that's being done on the pixel colors, and didn't take time to figure it out. (Most of the fragment shader is copied directly from Processing example.)
You would need the shader-support branch of my fork of 60Hz's abstractions: https://github.com/jamshark70/Ofelia-Fast-Prototyping/tree/topic/shader-support -- don't use the main branch! This is all still experimental and not ready to merge.
Then the foreground layer looks like this (haven't added background yet): 0801-chromakey-test.pd
The problem at this point is that I can't find HSV settings to make the green bits actually transparent. I would have expected that setting the range slider to 1.0 would make everything transparent, but it isn't even doing that. So there must be a logic error in the fragment shader, but I'm out of time for now. Maybe you can figure it out.
At least -- having a template that doesn't crash is a good step forward.
hjh