Chroma Key "pick from border" color selection

Kind of a fun improvement to the Chroma Key effect Key Color selection: have a button to pick the color from the current frame’s border:


:up_arrow: Here (youtube stock footage) it would choose a tint of green pretty close to the footage, which is not exactly the default #00FF00. But I’m not that experienced, maybe the point of Chroma Key color selection is to be far from the subject’s color, not to match the background exactly.

:up_arrow: I this example (a Krita recorder export) it would choose black.

The algorithm would be like:

  • Do a population count of pixel colors. For 1920x1080 frame, that would be 5998 pixels. Could be thicker, like 0.5% (minimum 1 px) thick.
  • Order by popularity, and keep the upper 25%. For that 1920x1080 frame, that would be about 1500+ “color occurences”.
  • Average the color.

If it’s done on the middle frame of the sequence that the effect is applied to, you probably get it right most of the time for basically the cost of decoding a frame and playing with a color histogram subset of the pixels.

In my mind, it’s a low cost, low value, low risk feature, but it could make people think about chroma key color selection.

1 Like