The IBK keyer differs from many other keyers in that, instead of using a single color picker, it uses an input image (a clean plate with just the color variations of the background) to drive the key. This generally gives you good results when working with uneven blue- or greenscreens.
The IBK keyer consists of two nodes: IBKColor and IBKGizmo. IBKColor creates the clean plate from the blue- or greenscreen image, and IBKGizmo pulls the key.
NOTE: Pre-rendering output from IBKColor to some formats can result in loss of color information and incorrect results when the image is used as input to IBKGizmo. We recommended that the .exr format is used for pre-rendered images as it supports full float data, reducing loss of information.
As a general workflow guide:
1. | Connect the output from IBKColor to the c input of IBKGizmo. |
2. | Attach the input of IBKColor, along with the fg input of IBKGizmo, to the original blue- or greenscreen image. |
3. | Attach the bg input of IBKGizmo to your background image. |
4. | Create two Viewers and view the output from both nodes side-by-side. |
5. | Adjust the controls of IBKColor until you get a clean plate with nothing but the background colors. |
6. | Adjust the controls of IBKGizmo until you are happy with the key. |
7. | Connect the output from IBKGizmo to a compositing node, such as Merge, to composite the foreground over the background. |
Connection Type |
Connection Name |
Function |
Input |
1 |
The blue- or greenscreen image. |
Output |
unnamed |
Connect this to the IBKGizmo node’s c input. |
Control (UI) |
Knob (Scripting) |
Default Value |
Function |
Parameters Tab |
|||
screen type |
screen_type |
blue |
Select green or blue depending on which one you have in the foreground image. |
size |
Size |
10 |
Adjust the amount of color expansion. |
darks |
off |
0, 0, 0 |
Adjust the color values to get the best separation between black and the screen type color. You want to be left with shades of the screen color and black only. Start by bringing down the value for blue if you’re using a blue screen, and the value for green if you have a green screen in the image. The erode and patchblack sliders should be set to 0 when you’re adjusting these values. As a rule of thumb, if you have a dark green discolored area, increase darks g. Similarly, if you have a light red discolored area, increase the lights r value. |
lights |
mult |
1, 1, 1 |
Adjust the color values to get the best separation between black and the screen type color. You want to be left with shades of the screen color and black only. Start by bringing down the value for blue if you’re using a blue screen, and the value for green if you have a green screen in the image. The erode and patchblack sliders should be set to 0 when you’re adjusting these values. As a rule of thumb, if you have a dark green discolored area, increase darks g. Similarly, if you have a light red discolored area, increase the lights r value. |
erode |
erode |
0 |
Increase this value if you still see traces of the foreground edge color in the output. This might be especially useful if, after adjusting the lights and the darks values, you’re still left with areas of discoloration. This is likely if your screen does not have a very saturated hue. |
patch black |
multi |
0 |
After adjusting the darks and the lights, you can increase this value to remove all the black from the output image, if you want. This might be useful, for example, if you get blue/green artifacts in your composite. |
Keying - Step Up to Nuke Tutorial 8 from The Foundry on Vimeo.
One important task of compositing is the removal of bluescreen or greenscreen. Nuke provides a wide variety of keyers for this task. I am going to go through several of these very briefly just so you have an introduction. I have brought in two pieces of footage to try this on. There is a greenscreen of the man that we used previously and there is also a still image of a house. It just has a bright sky and, even though there is no green or blue in this particular photo, you can still use keyer tools to attack the sky and remove it. You can reach the keyer tools through the Keyer menu.
I am going to start with the simplest one, which is called Keyer. Now, even though it doesn’t have a lot of options, it is great for certain circumstances like this. I am going to drop down the A pipe between the Merge and the Read node. The Keyer has several operations, one of which is luminance key, which is default. You can also target certain colors like green, or certain properties like saturation. We will leave it at luminance for now. There is also a graph here, which represents the operation values. For example, this graph represents luminance, as it runs from 0 towards 1, or the maximum. There are also four yellow bars here: A, B, C, and D. You can click-and-drag those interactively. Now B and C are overlapping at the start, but you can separate them. As soon as I move these, the alpha matte will start to be formed. Let’s go take a look at that. I am going to go into the Viewer and press the A key; there’s the alpha channel. What this signifies is any pixel with a luminance value between B and C becomes opaque. Any pixel value that had a luminance between C and D, or B and A, has a tapering value somewhere between opaque and transparent. So, in this situation, what I can do is move B and A towards the far-left, and then adjust C and D to make the sky mostly transparent. For example, what this means is any pixel with a luminance value over 0.9 becomes 100% transparent, or if a pixel has a luminance value between 0.8 and 0.9 has tapering transparency.
Let’s go back to rgb. Press the A key again, and there we go. Now, it doesn’t look like anything is happening right now. What you have to do with the Keyer is premultiply the alpha. So, I will select the Keyer node, right-mouse-button-click, Merge > Premult. Premult multiplies the alpha values by the rgb values. Once I add this, the sky is removed. Now I can test this further. I can hook something up to the B pipe of the Merge. For example, I can right-mouse-button-click, and go to Image > Constant. Constant will produce a solid color - I will hook that up to the B pipe. Then go to the color wheel for that node and pick a color, like light blue. The sky is gone and now the Constant appears in the sky area.
Let’s move on to some other keyers. I am going to go back to the greenscreen footage. Now, in fact, you can have more than one Viewer in any project. You can make a new Viewer at any time by going to the Viewer > Create New Viewer (Ctrl/Cmd+I). If you have more than one Viewer, you can switch between them by clicking the tabs. So now, we are going to work on this greenscreen. The first keyer we will try here is Keylight, so Keyer > Keylight. The Foundry writes Keylight and, in fact, it is available in other compositing packages like After Effects, the functionality is the same. It looks a little intimidating at the start because of all the inputs. What you have to do is plug the Source into the greenscreen, in this case, the A pipe into the output. Now there are many options you can adjust. I am going to adjust the basic ones you need to remove the greenscreen. The first thing to do is select the Screen Colour. You can click the swatch here, get the eyedropper, and go back to the Viewer. There are several ways to sample pixels with the eyedropper. You can Ctrl/Cmd+click or Ctrl/Cmd+drag your mouse. I will try the drag, so click+drag, let go - the screen color is sampled and you will see it right here in the swatch, and also beside the Screen Colour property. Let’s take a look at the alpha. Now, Keylight offers this View menu, which you can change from Final Result to Combined Matte. That’s what the alpha channel looks like, so right now there is some gray in the transparent area. What you can do is raise the Clip Black to erode that. What the Clip Black does is it looks for any pixel less than the slider and it makes it 100% transparent. There is also some gray in the white area. You can lower Clip White to make them more opaque, and now the matte looks pretty good. Once the matte looks good, you can return the View to Final Result. Now, to test that, I will disconnect the Constant over here, and plug it into the B pipe here. There we go, that’s pretty successful. Let’s try another keyer. I am going to disconnect Keylight, disconnect constant, and move that aside.
Now we will try Primatte. Primatte has been updated for Nuke 7, so now it’s even more powerful. In this case, I need to hook the fg or foreground to the greenscreen and then the output to the A pipe. Primatte has a very powerful button called Auto-Compute. If you click that, it will attempt to identify the screen color and remove it. In fact, it does a really good job right off the bat. Let’s see what the alpha looks like. I will press the A key again, and there it is. Again, there is some noise around the edges. Fortunately, Primatte offers a long list of operations you can use to clean up the matte. For example, I can switch this menu to Clean BG Noise. Now I will zoom in, and now, I can sample those pixels that are too gray. Another way to sample is to Ctrl/Cmd+Shift and draw a marquee box around the problem area that samples a whole bunch of pixels at once.
So now the edges are looking better, but there is still some gray on his jacket. We can then switch the menu to Clean FG Noise and then sample those pixels. Now that becomes more opaque. Let’s take a look at the rgb again. Press the A key - there it is. It looks pretty clean, however, there is a lot of green spill from the greenscreen in his clothing. In that case, I can go to Spill Sponge and sample those pixels to pull the green back out. There it goes. Now it’s not perfect yet, but you can see how quickly you can move the green. Let’s go ahead and plug in the Constant though and see what that looks like. Alright, let's move on to one more keyer. I will disconnect this one, move it aside.
Now we are going to try the IBKGizmo and IBKColor: two nodes that are designed to work together to tackle greenscreen or bluescreen. So Keyer > IBKColour and Keyer > IBKGizmo. Now, the connections here are a little bit more complicated. Basically, the 1 input for the IBKColor goes into the greenscreen, as does the fg for the IBKGizmo. Then the c, or color input pipe for the IBKGizmo, goes to the IBKColor node. Then the A pipe for the Merge goes to the output of the IBKGizmo. Let’s take a look at the options. The first thing to change is the screen type for the IBKColor node. It is set to blue by default, but you can change it to green. That looks a little funny here in the Viewer, but what I can do to see what the IBKColor node is doing is plug the Viewer into that node. Here, it’s targeting the color green; whatever color is not green it’s removing. Now the aggressiveness of the removal is controlled by the size slider. If I increase that, there is more averaging and there is fewer and fewer non-green colors. Let’s plug the Viewer back into the IBKGizmo. The color information is passed from the IBKColor node to the IBKGizmo node, which the IBKGizmo node turns into a matte. Now the first thing you need to do with the IBKGizmo is make sure the screen type is set to the same color, in this case, green. Let’s plug the Constant into the B pipe and put the Viewer back to the Merge node, and there we go - successful greenscreen removal.
Now, I know all of these keyers have numerous options, which we didn't talk about. This is just to give you a brief introduction and to show you there is a wide range of keyers to tackle pretty much any type of footage.
“Tears of Steel” footage courtesy (CC) Blender Foundation - mango.blender.org