video processing – How do I chromakey an enclosed shape (or background) in ffmpeg?

I have an animation with a fully contiguous 0xFFFFFF white background I want to remove. The issue is that the foreground contains the same exact color. These parts are all completely enclosed and contained within at least several pixels of a different shade at its weakest.

All I need is to be able to essentially, for each frame, make all pixels that are white and connected by white to 0,0, transparent. Chromakey and its siblings remove those bits from the foreground as well which is unacceptable and backgroundkey, well you can imagine how that goes.

I’m somewhat proficient with ffmpeg and can handle severe filter shenanigans, I’ve just thought about this for like 10 min and decided I seemingly don’t have the creativity to piece together a clever solution. I just don’t want to have to spend some time sitting down and manually writing out a program to do this frame-by-frame.

Read more here: Source link