How do you colour correct edge despill?


I can now make clean plates, core mattes, combine keys, etc. However, in Natron, I haven’t found a way to correct edge colours after despilling either blue or green screens. I get either a very strong ( in the case of green) yellow border of varying luminace, but always annoying. I’ve improvised a few methods, but none of them feel practical. So, I must ask the community:

  1. Could you suggest a workflow and method for colour correcting edge spill within Natron; and

  2. Should I place an unpremult before colour correcting and then shade it with a premult? I ask this because I’m a bit confused at the presence of th (un)premult checkbox in various nodes (Grade and ColorCorrect, for example)

Any advice would be appreciated.


For your first question:
Method 1:
A general workflow could be to use the mask that you have, invert it and erode it in, blur it and use that as a mask for the color correction. This way you make the color correction only affect the edges. In the case of a rather uneven green/blue spill you might want to split up that edge mask and use different amounts of erosion, color correction and blur per section.
Method 2:
You can also try to insert a SeExprSimple in your color branch and in the G channel you use this expression:
g > (r+b)/2 ? (r+b)/2 : g
This checks every pixel if the green information is greater than the avarage of red+blue. If so, only use the red+blue avarage, if not it can keep it’s green information.

For your second question I’m not quite sure want you want to do.


First of all, Method 1 sounds great. just tried it and it’s very promising. I’m going to not only break it up to affect different edges according to their needs, but I’m also going to try to Merge the BG in there, too and see what happens. THANKS!

Method 2 is something I was already toying with (I like granular control over my pixels through math when possible). I was doing it through SeExpr, but SeExprSimple can be so much more efficient - THANKS!

For my second question, I was just wondering if I should unpremult my FG image before applying any of the above and then reapply it at the end - classic Unpremult => Colour processes => Premult again. I ask this because I don’t when when it’s redundant and when it’s appropriate because of the (Un)premult checkbox being present. I mean, I don’t want to premult or unpremult in the inappropriate spot when either might be engaged at that point in the graph.


Well that depends on your scene. Unpremultypling your FG presupposes that it got premultiplied in the first place. If it didn’t, you don’t have to unpremult it.
I don’ know your keying workflow but my general rule of thumb is:

  • FG unpremultiplied.
  • make a branch where you generate your alpha with keyers, masks, filters, color corrections
  • copy that channel into the FG branch
  • premultiply
    The color correction for despill I would do before the copy node.
    Every other color correction that comes after the premult you should check the checkbox that says (un)premult, cause that internally will unpremult the image by its alpha > apply the color correction and reapply the alpha.

I’m not quite sure if any of that answers your question.


Your workflow is sound and you totally answered my question, foobuntu, by the simple virtue of stating what the (un)premult checkbox does. You may have just ended a lot of head scratching :slight_smile:


Hi hpetrus,
there are a couple a PyPlug that achieve very good results to despill eges :

There is also the ld_ChillSpill Lucas Pfaff did, the most advanced of them, but it’s broken and needs to be fixed.


Thanks, foobuntu. I know DespillMadness (from recent days), but not
AFX_Despill_GL. I am very impressed with this community, already.

Thanks for being on top of it.


That’s fabio17’s credit actually. :wink:


Ah! So sorry. Yes, thank you, fabio17!