Chroma Key: Advanced, which HCI color space?

I’m trying to wrap my head around something.

I was supplied a video which is far from a clean chroma key plate, but I figured I should be able to get it going alright as foreground elements were still a fairly different color from the background.

But when I tried to set it up with Chroma Key: Advanced in Hue-Chroma-Intensity color space, even small hue and chroma delta values ( < 5%, < 1% on Intensity ) captured both. Obviously I can switch to RGB (which presented some issues with overlap in other regions, but it worked out in the end with multiple entries), so this is purely a “… what’s going on here?” thing.
If I had some idea of the color space it’s matching in, I might be able to go “oh yeah, I guess in that color space those colors are similar”, but at the moment I can’t think of a hue-oriented color space in which that would be the case.

Attached is a sample project file and sample image with two colors.

chromakey-test.mlt (4.9 KB)

I cannot help you with the advanced color science, but here you can access the code along with a readme of notes that might help. You can even dig into the source code if you want or try to contact the author mentioned at the top of the source code file in comment.

1 Like

Went down the rabbit hole, and I think the way they’re dealing with the hue term in the distance function may have an issue. I’ll see if I can reach out to the author. Thank you!

Reached out to the author, they acknowledged the issue and potential fix. Submitted a pull request for the code. Provided I didn’t royally screw that up, should make its way into a future version of the frei0r plugins and subsequently Shotcut.

1 Like