Keying only a certain amount of an image/video

Hi! This is quite hard to explain, I try my best. I have different videos as an input and I can switch between them. Now I want to key them with a Chroma Key TOP for example - but I only want to key so much, that exactly 50% of the input is gone (alpha) and the rest is still there. In other words, I want to delete the brightest half and keep the darkest half of pixels (or the most saturated half etc. - It doesn’t matter if the Key is based on brightness, saturation or hue).

This seems quite difficult because all the videos have a different overall brightness, hue and saturation.

Thank you in advance!

Yes, its quite hard to understand…
I tried to give a solution:
– transform RGB to HSV (rgbhsv top), extract Value (channel b)
– calculate the median Value (analyse top with sum, divide by number of pixels
– create the alpha layer with GLSL top
– apply alpha layer to the image (reorder top)
medianValue.toe (6.2 KB)

partial_key.toe (5.6 KB)

here’s a different approach without GLSL. I’m using threshold to get luminance, you could combine chromakeyTOP to make it color selective as well.

This is exactly what I searched for, thank you both very much!

I actually found another way by splitting the input into several Chroma Key Partitions and then combining them back together. Probably have to see the file to understand what I mean.

I did it with 5 partitions but if you’d do it with like 20 then it’d be pretty close to this idea of slider=0.5 → 0.5 of the input is keyed.

ChromaKey_Average.toe (6.0 KB)

these are all great solutions!