Noob greenscreen maths question

Hi all,

I’m dealing with some stock greenscreen footage that is very clearly a CG render that has been Over’ed with pure digital green, because why in TYOOL 2021 would stock footage houses be able to store video wit alpha? Is there a stupid comp math thing I can do to cleanly get it out of there? I tried making a color source of said green and playing around with divide etc, but got nowhere. I can get the asset where I need it to go by beating on it with the Master Keyer and Pixel Spread, but if there’s a cleaner way to do this I’d rather avoid the pixel spread. Any ideas? Thanks!

As in fully opaque?

And do you need a key or a despill?

The CG has motion blurred edges, so not fully opaque. I’m wondering if there’s a better/purer way from a comp standpoint to key and despill the whole thing if my green is uniformally 0,255,0.

It’s keying fine right now with the MasterK, but I’m having to hit it with Pixel Spread harder than I’d like to clean up the motion blurred edges.

Yeah. I saw this the other day when searching for stock footage of birds.

I didn’t buy any that day but my first thought would be this:

Sample that solid green and subtract it from the plate. The difference of that should give you their alpha.

To be honest, who knows how good their alpha will be.

Use the alpha to divide the subtracted plate this should un multiply any soft edges.

Just my first thought on some maths but I would be prepared for it to be a little rough. Also if the image has some green, like a parrot, then you might need to deal with that somehow.

Did you try despilling in masterk using the cc front output option ?

And try do a diff matte using cc output.

Maybe, you could try Joel Osis Additive keyer method? Should help, at least with MB

1 Like

Can we do expressions on the image without using a matchbox shader? :thinking:

If so, this would be some math to get started:

factor = 1 # play around with this. something between 0.5 - 1 should do it

# r = red, g = green, b = blue
# apply this to the green channel
g = g > (b+r) / 2 * factor ? (b+r) / 2 * factor : g

# to generate an alpha channel after the above equation:
alpha = max(r+g+b)

You can easily do this in Nuke with the expression node, but I don’t think we can do this in Flame, right?

Subtracing the green worked great except for the parts of the fg that contained any green (like yellow, fer instance.)

I was already despilling with the MasterK set to FrontCC. When I have time I may try to figure out how to pull of what @claussteinmassl mentioned, but for now pixel spread it shall be! Thanks, all!

Despill it like this.