1
$\begingroup$

EDIT #3

The original title of this thread was: "Why is alpha-over node not as good as in the VSE?" and I think the best answer to that is from @troy_s:

You have to remember that the compositor and the VSE operate in radically different ways, so don't expect a correspondence between values.

Since then the discussion has moved on to Key node settings, so I am changing the question. For reference, the original post follows ...

I am making some video presentations of student art work, where the students are keyed over their art.

I started by saving the keyed "talent" as .png sequences and using the VSE to overlay that on top of the art.

from VSE

This is acceptable considering the video was taken with a tablet, using green corrugated PVC board as a green-screen.

But the process is very time-consuming and I have about 600 shots to do!

So it occurred to me that I should be able to put everything together in the compositor to make it more efficient.

However, the Alpha Over node in the compositor is making parts of the "talent" transparent.

enter image description here

At first I suspected the output from the Keying node. Somehow, it might not be the same as a .png file. So, to trouble-shoot, I tried using the same frame from the .png image sequence instead of the direct output, but the result is the same either way.

node setup using .png image file

So, before I go back to saving everything as .png sequences, can anyone tell me a way to get the Alpha Over node to behave the same as the Alpha Over VSE effect?

EDIT #1

Thanks to @cegaton for getting involved. Here is the .png image.

enter image description here

And here is the original node setup before I started trouble-shooting.

enter image description here

I really can't see how the .png could be the problem because:

  1. Originally, I was trying to take the output directly from the Key node without saving to a .png; and
  2. The .png sequence works as expected in the VSE - it produced the (acceptable) image at the top of the page.

In fact saving to a .png sequence solves the problem (in that I can use it in the VSE) rather than causing it. But I'd prefer to avoid that as it's time-consuming.

EDIT #2

@cegaton Oh dear! I really wish I'd made no mention of PNG as it has been a distraction.

To clarify:

  1. If you look at the original node setup (i.e. the one after EDIT #1) there is no hint of a PNG image anywhere.
  2. The problem is that, using that node setup, I noticed that the keyed output had some bleed through from the background image.
  3. I didn't know whether the problem was with the Key node or the Alpha Over node, so I used a standard trouble-shooting technique to find which one was the culprit.
  4. It was only then that I tried replacing the Key node with the Image node, since the PNG sequence worked well in the VSE.
  5. I actually suspected that my Key node settings were at fault, and was surprised that replacing the Key node with the Image node produced exactly the same results!

node comparison

  1. So, since a) the Key node and Image node produced the same results in the compositor, and b) the Alpha Over effect in the VSE produced much better results, the logical conclusion is that either:
    • the Alpha Over node is somehow different to the Alpha Over effect in the VSE; or
    • the VSE is feeding the Alpha Over effect differently to the way the compositor feeds the Alpha Over node.

So, not using PNG images cannot be part of the solution because I wasn't using them in the compositor before I started trouble-shooting.

However, I think @cegaton is probably right in that the solution is in adjusting the Key node settings. I suspect what is actually happening is that the VSE is somehow disguising the problem with the keying.

I just wish I could find a way to replicate whatever the VSE is doing in the compositor!

EDIT #4

Thanks to all for the contributions so far. Here is a screenshot of the original video.

unkeyed image

As you can see, the variation in green colour makes keying very difficult. I am used to chromakey where there is a setting called "tolerance" or something similar. I also vaguely remember stacking chromakeys in Kdenlive for severe cases such as this where the bottom panel is so much darker than the others.

The Key node in Blender is much better because it has "Despill" but I do miss the tolerance setting. Reading the Blender manual, I think I need to replace the single "Key Color" with a range, but I'm not sure how to do that.

As usual any advice would be most appreciated.

$\endgroup$
  • $\begingroup$ Does the image you are overlaying have an alpha channel? If so, how was that created? Please show more images of the elements used. $\endgroup$ – cegaton Apr 23 '18 at 19:41
  • $\begingroup$ Thanks for the query @cegaton. Yes, the image in the final example does have an alpha channel. It is a .png created by blender with rgba set in the output section. I deliberately did not include the node setup that created that image, because it works fine with the VSE Alpha Over effect. $\endgroup$ – Thailandian Apr 23 '18 at 20:37
  • $\begingroup$ Hard to tell without seeing the image and it's alpha channel. PNG is a terrible format as it doesn't do proper associated alpha, maybe the problem is there, but I am terrible at guessing and speculating, I prefer information and facts.... For all I know, the compositor's alpha over node works fine with images that have a proper alpha channel. How was that alpha channel created out of the green background? $\endgroup$ – cegaton Apr 23 '18 at 21:04
  • $\begingroup$ Thanks again for the ideas @cegaton. Please the the revised question beginning at "Edit #1". $\endgroup$ – Thailandian Apr 23 '18 at 21:47
  • $\begingroup$ Can you post the original greenscreen image you used in your sample as well as the background plate? You have to remember that the compositor and the VSE operate in radically different ways, so don't expect a correspondence between values. $\endgroup$ – troy_s Apr 24 '18 at 5:19
4
$\begingroup$

Below is the default settings for the keying node.

Partially transparent key

Change the Clip white and clip black to make the key more dense.

Improved matte clip values

To test this, replace your background with a hot pink or yellow color image. This will make the partially transparent regions more obvious.

Before adjustment: failed test

After adjustment: passed test

You can use a Chroma Key node to create the core matte. This does the heavy lifting of cutting out your main shape. Then you use the Keying node to soften the edges. I have introduced a mask to cut out the extra wall on the side.

improved key

$\endgroup$
  • $\begingroup$ Thanks for this. I have now changed the thread title to suit where the discussion has led. Also, please see EDIT #4 for a screenshot of my original video. That should give a better idea of what I'm up against! $\endgroup$ – Thailandian Apr 25 '18 at 9:43
  • $\begingroup$ Wow - that's fantastic @3pointedit! I'd started to get much better results using just the first part of your answer, but this is better again. The colour ramp was a big part of what I was looking for, but I also realise that the Edge Kernel, Clip Black and Clip White together perform a function akin to chroma-key "tolerance" (I guess it's "acceptance" in Blender. $\endgroup$ – Thailandian Apr 25 '18 at 13:22
  • $\begingroup$ One thing I haven't been able to get so far is the view of the alpha channel of either the Viewer Node or Render Result. As soon as I select that, I get all white regardless of what Clip Black and Clip White are set to. Any ideas? $\endgroup$ – Thailandian Apr 25 '18 at 13:35
  • $\begingroup$ Yes you cannot see the alpha channel after passing through the Alpha Over node. You must get it directly from the Keying node. $\endgroup$ – 3pointedit Apr 25 '18 at 13:58
  • 1
    $\begingroup$ Also good luck with the big job ahead. After all this I should point pout that you can in fact make a chromakeyer in the VSE. blender.stackexchange.com/questions/78947/… and my tutorial youtube.com/watch?v=1mVm4hwO0EU $\endgroup$ – 3pointedit Apr 25 '18 at 14:01
3
$\begingroup$

First read this related answer:

Now on to the issue at hand:

Open your image in the UV/Image editor and look at the RGB and Alpha information:

enter image description here

Your alpha channel is not as solid as you would nee it to be, all of those black and gray spots on the mask prevent the mask from being opaque...

Plus the RBG channel contains information that should not be there (alpha is not associated)

enter image description here

How to fix it:

  • Rework your settings for the key and get a cleaner mask

  • Associate the alpha channel to your output image.(see: Partly Ignored PNG Alpha?)

  • Avoid PNG and use other fomats like EXR or TIF

  • Use alpha over with the same node tree you are currently using to composite and things should be fine.

$\endgroup$
  • $\begingroup$ Read also: blender.stackexchange.com/questions/46312/… $\endgroup$ – cegaton Apr 23 '18 at 22:32
  • $\begingroup$ Avoid PNG and use other fomats like EXR or TIF. > Why (in this case)? Benefits? $\endgroup$ – Leander Apr 23 '18 at 22:59
  • $\begingroup$ @Leander look for the many posts on this site on why PNG sucks (just do a search on this site for "PNG" and "associated alpha"). EXR uses a proper associated alpha channel, on top of keeping information linearly. $\endgroup$ – cegaton Apr 23 '18 at 23:17
  • $\begingroup$ Cegaton's answers are on point. I'd only add @Leander that only associated alpha represents a physically plausible model that represents emission (the RGB values) and occlusion (the alpha channel). This means that they can be operated on in tandem as though they are four equal channels. Convolutions, rotoscopes, emissions without occlusions (candles, glows, lens flares), etc. all only behave correctly when associated. Without associated alpha, rotoscopes will fringe / bleed, convolutions will contaminate, and glows / flares / blooms are impossible. $\endgroup$ – troy_s Apr 24 '18 at 5:03
  • 1
    $\begingroup$ Bad news @cegaton, despite TIFFs being associated alpha without additional tags and planes, try loading an 8 bit TIFF with Blender. The cancerous design spread to everything 8 bit. $\endgroup$ – troy_s Apr 25 '18 at 15:43
1
$\begingroup$

For practical reasons, I'm going to have to leave this for the moment, but first, want to highlight this quote from @troy_s:

You have to remember that the compositor and the VSE operate in radically different ways, so don't expect a correspondence between values.

That is the most direct answer to my question: "Why is alpha-over node not as good as in the VSE?"

Everything else has been useful and interesting, but that is the answer I needed, so it would have been a shame if it went unnoticed.

$\endgroup$
  • 1
    $\begingroup$ If you can provide the original still image someone here can pull a good key for you. In your PNG in your answer, there are two problems with it. First it is a PNG, and as a result, the image isn't in the correct alpha format for the Alpha Over node, which assumes Associated Alpha. Second, you have an alpha value of < 1.0 in regions of the head, which is why you are getting bleed through. The key pull is at fault and is easily corrected. $\endgroup$ – troy_s Apr 24 '18 at 17:37
  • $\begingroup$ Thanks for the suggestion @troy_s. As I've said, the PNG part is irrelevant because what I'm trying to do is go directly from the Key node to the Alpha Over node. But help with the keying itself is a good idea. As I hinted at in a previous comment, the root problem is that the green is too variable because of the lighting. And I can't work out how to make a colour range for the Key node input. Rather than a screen cap still, I'll upload a short example video somewhere and post a link. If anyone would like to have a go at it, it would be most appreciated. $\endgroup$ – Thailandian Apr 25 '18 at 2:04
  • $\begingroup$ You aren't listening to what I and others are trying to impress upon you; the PNG is part of the problem. Your alpha is unassociated and that means that it is not suitable for feeding into the alpha over node without the poorly labelled "convert premul" box checked. The other part is simply unfortunate values in the keying node, whatever you are using. I'd be happy to pull a key off of a still image if you can post one, and I'll provide you the node group. Video can work too. $\endgroup$ – troy_s Apr 25 '18 at 2:58
  • $\begingroup$ @troy_s I'll try to explain with a metaphor. Suppose that my problem is "I fear for my safety" and part of your answer is "Well you shouldn't live in Afghanistan". While that is undoubtedly good advice in a general sense, it is not part of my problem because I don't live in Afghanistan! Please understand, I'm not trying to downplay what you and others are saying about PNGs, but if you look at the SECOND node setup (i.e. before I started trouble-shooting), I wasn't using a PNG, so logically, PNGs cannot be part of that problem. $\endgroup$ – Thailandian Apr 25 '18 at 9:00
  • $\begingroup$ @troy_s I thought I should separate the parts of my response for clarity. I was actually planning to start a new thread for the sake of search engines, but since 3pointedit has already posted an answer relating to the Key node, I'll change the title of this one. Thanks again for your offer of help. And you're right, working with a still should give a pretty good indication of the key settings I need. $\endgroup$ – Thailandian Apr 25 '18 at 9:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.