Any interest on Chroma Key layer?

I wonder if there is a way to make a Chroma Key in Synfig.
If not, is there any interest on having this layer (similar to Luma Key)?


I support this.
Additional ways of masking is always a good thing.


Will anyone be able to draw an icon for it? XD

Perhaps something similar to Luma key’s icon? Since chroma key is very close to it in meaning. I am not good at designing stuff, but here’s my entry:
layer_filter_chromakey_icon.sif (41.3 KB)

Color green is chosen because of green screen, the most popular usage of Chroma key. Here’s how it looks in Layer’s menu (ignore that it says ‘Luma Key’):

1 Like

Man, you’re quick.
I promise to test and report back some time this week.


Okay, I did some testing, here’s what I found:

  1. Tip for ‘Key Color’ is wrong. It reads: “When checked, the Ceiling value is used”. Obviously, a copy-paste error. Should be something along the lines of: “Color to be made transparent”.
  2. ‘Upper Bound’ parameter works weird in cases when colors are very close to the mask. It produces a semi-transparency effect:

Which is an error I would guess, because ‘Lower Bound’ doesn’t produce the same effect.

ChromaKey.sif (10.8 KB)

You can see on the screenshot, that ‘Chroma Key’ doesn’t work well with feathering (white region)/anti-aliasing but I suppose it’s a technical limitation (it would work the same way in a video editor).

1 Like

About the boundaries: I compute how close a color chroma is different from that of key color.

If the value is below the lower bound, it becomes completely transparent. If above upper bound, it stays as it is. In the middle, its alpha channel is proportionally changed.
Do you think it is bad?

If you user doesn’t want this in-between effect, just set lower bound equals to upper bound.


I’ll investigate it.

Oh, I see. I didn’t get the full idea how it works. It’s good.

I don’t think you can do anything about it. The feathering blends colors and the result obviously won’t correspond to the mask anymore. Luckily, you can uncheck anti-aliasing from regions and outlines and put a ‘Super sample’ layer on top of ‘Chroma Key’. Feathering can be done after using ‘Blur’ layer.

And besides, I’d say the main use of ‘Chroma Key’ is for raster graphics (sprites, pixel art, cut-out pieces).

Should I embed this feature on ChromaKey?

Embed? Without a choice? The ‘Super sample’ functionality - definitely not, because user may want sharp edges (think pixel art). For anti-aliasing, if it’s possible to introduce one additional bool type parameter, something like ‘Disable Anti-Aliasing’ that if checked will disable it for every single layer below ‘Chroma key’, then I would go for this approach.

Well, there is always the option to make it (0,0) to disable it.

I’m afraid it is not possible: a layer does not change parameters of other layers.

So you’re talking about an option, not embedding. I thought by ‘embed’ you meant hard-coded.
In short, you just want to add ‘Super sample’ functionality as an option, correct? If so - go for it, it’s a good idea.

Hm… I couldn’t see any visual improvement by using SuperSample. :confused:

Because you forgot to change rendering mode from ‘Preview’ to ‘Final’ :wink:

1 Like

Damn it! :slight_smile:

Do we need to let both supersample width and height available? I guess just one is fine (force it square).

@Svarov Please take a look at my proposal again :slight_smile: add new Chroma Key layer by rodolforg · Pull Request #2553 · synfig/synfig · GitHub

1 Like

Yeah, I think it’s fine.
Not sure about ice0’s idea though. I’d say it’s not important right now, because Synfig isn’t a video editor, we rarely work with real photos where light source is complicated but rather with sprites/cut-out that designed in a way to be properly cut by chroma mask. Maybe in the future, but it’s unnecessary in my eyes.

Not gonna lie, I always used it with the same height and width, but let’s keep it for now. Maybe it’s useful in some ways. And besides, ‘Chroma key/Super Sample’ layers don’t have overwhelming amount of parameters to cause confusion.

1 Like

I forgot about his suggestion XD