<p>The problem is that my alpha Mask has a feather. Which results in greeen peaking through the Mask. So the only solutions are export an alpha mask with no feather or export the original image with a black or desaturated background.</p>

<p><img src="https://i.sstatic.net/iLSod.png" alt="Feather"></p>

CC BY-SA 3.0
2015-01-31T12:45:34.423Z
I'm still wondering though, why it does not have that problem when it is still in After Effects. I guess Keylight automatically desaturates the green on the semitransparent areas of the Alpha.
Benedikt
CC BY-SA 3.0
2015-01-31T15:20:48.133Z
If the feather is properly positioned it shouldn't matter, but if the feather is too far out it would be. You could try upping the edge growth or whatever the equivalent setting is to move the feather in to keep a soft edge.
AJ Henderson
CC BY-SA 3.0
2015-01-31T19:12:25.950Z
What I'm wondering though is why it looks ok in After Effects though.
Benedikt
CC BY-SA 3.0
2015-02-03T21:38:31.140Z
I'm not an expert at this, but you might be running into a problem because of working in a non-linear colorspace.  IDK if that's even the right term, but I've seen ffmpeg docs or something say something about color spaces being linear or not.  I assume that means something like alpha blending will suffer from color shifts if done naively (new = alpha-weighted sum of all inputs) in a non-linear colorspace.  So that's what you should google if you want to maybe figure out what Keylight did.
Peter Cordes
CC BY-SA 3.0
2015-01-31T12:43:14.727Z
2015-01-31T12:43:14.727Z
Benedikt
<p>Part of it may be the fact you are using JPEG sequences.  JPEG isn't a pixel accurate format and you are going to have some differences in block quantization that could potentially result in mismatches.</p>

<p>I don't think that is the only issue since it is a bit too regular for it to be the only issue, but I'd try to use an intermediate format that is a bit more lossless for doing things that need to be pixel accurate match up.</p>

CC BY-SA 3.0
2015-01-31T12:46:23.540Z
It has the same problem with a multichannel exr. So the jpeg shouldn't be the issue.
Benedikt
CC BY-SA 3.0
2015-01-30T23:55:59.993Z
2015-01-30T23:55:59.993Z
AJ Henderson
<p>I have two (rgb) jpeg sequences one with the alpha information (black and white) the other one with the green screen footage. I keyed them with Keylight and they look perfect in AE before exporting.</p>

<p><img src="https://i.sstatic.net/VMFA8.png" alt="key"></p>

<p>When I import the jpeg sequences back in AE and apply the alpha, I get a green hallow.</p>

<p><img src="https://i.sstatic.net/Wwa89.png" alt="premult"></p>

<p>It seems to be some premultiplication issue. What did I do wrong exporting / importing the jpeg sequences?</p>

<p><img src="https://i.sstatic.net/tRnCV.jpg" alt="greenscreen">
<img src="https://i.sstatic.net/Vi6eM.jpg" alt="alpha"></p>

CC BY-SA 3.0
2015-01-29T12:01:35.377Z
Do you've tried another format like png/tga with alpha?
p2or
CC BY-SA 3.0
2015-01-29T12:03:43.977Z
I have tried exr with an alpha. Same problem in nuke! I need it as a jpeg format though.
Benedikt
CC BY-SA 3.0
2015-01-29T12:05:58.423Z
You need the jpg alpha's for creating an alpha channel in nuke, right? Unfortunately can't test it at the moment. Can you provide an image to test with?
p2or
CC BY-SA 3.0
2015-01-29T12:33:47.750Z
Added test footage. I need it for 3ds Max but it would be nice to know what to do in After Effects or Nuke.
Benedikt
CC BY-SA 3.0
2015-01-29T17:05:55.353Z
Same with nuke... For now you can add an Erode(Filter) and a Blur node (quadratic) after that to move the mask/shape inside.
p2or
CC BY-SA 3.0
2015-01-29T17:52:22.227Z
My solution for now is to render the keyed footage with a black background and not the original footage with green screen. I'm still wondering if could preserve the green screen in the footage and still not get the nasty halo.
Benedikt
CC BY-SA 3.0
2015-01-30T02:34:59.873Z
Looks like you need to use a spill suppresser to kill the green in the areas where the alpha channel is not 100%.
stib
CC BY-SA 3.0
2015-02-03T10:40:03.190Z
Lossless compression for the alpha channel would be better, if you can use something other than JPEG.  JPEG has ringing on sharp edges, and the only thing that matters for alpha is edges.  (because interiors are solid color, trivial for any codec).  Image formats like webm have the option of lossy compression for the RGB, and lossless alpha, for example.  If you're at high enough rez and high enough bitrate, there's probably no visible problem, though.
Peter Cordes
CC BY-SA 3.0
2015-02-03T21:39:00.177Z
(nvm, AJ already suggested that earlier)
Peter Cordes
<after-effects><greenscreen><chromakey>
Premultiplication issue with two jpeg sequences
Benedikt
# Premultiplication issue with two jpeg sequences

(Asked by: username_0 on 2015-01-29)

I have two (rgb) jpeg sequences one with the alpha information (black and white) the other one with the green screen footage. I keyed them with Keylight and they look perfect in AE before exporting.

![key](https://i.sstatic.net/VMFA8.png)

When I import the jpeg sequences back in AE and apply the alpha, I get a green hallow.

![premult](https://i.sstatic.net/Wwa89.png)

It seems to be some premultiplication issue. What did I do wrong exporting / importing the jpeg sequences?

![greenscreen](https://i.sstatic.net/tRnCV.jpg)
![alpha](https://i.sstatic.net/Vi6eM.jpg)

**Tags:** after-effects, greenscreen, chromakey

> **Comments:**
> **username_1**: Do you've tried another format like png/tga with alpha?  
> **username_0**: I have tried exr with an alpha. Same problem in nuke! I need it as a jpeg format though.  
> **username_1**: You need the jpg alpha's for creating an alpha channel in nuke, right? Unfortunately can't test it at the moment. Can you provide an image to test with?  
> **username_0**: Added test footage. I need it for 3ds Max but it would be nice to know what to do in After Effects or Nuke.  
> **username_1**: Same with nuke... For now you can add an Erode(Filter) and a Blur node (quadratic) after that to move the mask/shape inside.  
> **username_0**: My solution for now is to render the keyed footage with a black background and not the original footage with green screen. I'm still wondering if could preserve the green screen in the footage and still not get the nasty halo.  
> **username_2**: Looks like you need to use a spill suppresser to kill the green in the areas where the alpha channel is not 100%.  
> **username_3**: Lossless compression for the alpha channel would be better, if you can use something other than JPEG.  JPEG has ringing on sharp edges, and the only thing that matters for alpha is edges.  (because interiors are solid color, trivial for any codec).  Image formats like webm have the option of lossy compression for the RGB, and lossless alpha, for example.  If you're at high enough rez and high enough bitrate, there's probably no visible problem, though.  
> **username_3**: (nvm, AJ already suggested that earlier)  

---

## 2 answers

### Answer by username_0 on 2015-01-31. Score: 1

The problem is that my alpha Mask has a feather. Which results in greeen peaking through the Mask. So the only solutions are export an alpha mask with no feather or export the original image with a black or desaturated background.

![Feather](https://i.sstatic.net/iLSod.png)

> **Comments:**
> **username_0**: I'm still wondering though, why it does not have that problem when it is still in After Effects. I guess Keylight automatically desaturates the green on the semitransparent areas of the Alpha.  
> **username_4**: If the feather is properly positioned it shouldn't matter, but if the feather is too far out it would be. You could try upping the edge growth or whatever the equivalent setting is to move the feather in to keep a soft edge.  
> **username_0**: What I'm wondering though is why it looks ok in After Effects though.  
> **username_3**: I'm not an expert at this, but you might be running into a problem because of working in a non-linear colorspace.  IDK if that's even the right term, but I've seen ffmpeg docs or something say something about color spaces being linear or not.  I assume that means something like alpha blending will suffer from color shifts if done naively (new = alpha-weighted sum of all inputs) in a non-linear colorspace.  So that's what you should google if you want to maybe figure out what Keylight did.  

---

### Answer by username_4 on 2015-01-30. Score: 1

Part of it may be the fact you are using JPEG sequences. JPEG isn't a pixel accurate format and you are going to have some differences in block quantization that could potentially result in mismatches.

I don't think that is the only issue since it is a bit too regular for it to be the only issue, but I'd try to use an intermediate format that is a bit more lossless for doing things that need to be pixel accurate match up.

> **Comments:**
> **username_0**: It has the same problem with a multichannel exr. So the jpeg shouldn't be the issue.  

---

