image1 image2 image3 image4 image5 image6 image7 image8


Color Keying In After Effects

01          In this lesson we will learn how to do Color Keying inside After Effects. We will go through the different stages of keying out the green screen or a green background from a footage. Open up the Color Keying 01 after effects file from the projects file folder. In the scene we have our actor in the center of a green screen along with some elements outside of the green screen that we don't want to show in the scene.

02          Before applying the green screen filter we will try to reduce the amount of work that it has to do, like in this case to get rid of the variations in the colour of the green background and the objects outside of the green screen. So in order to do that we will draw a loose Garbage Mask feathered at 20 pixels around the area which we want to get rid of. We will then animate it over the length of the shot so that we can make sure that we get only the things that we want to keep in the shot.

03          Once we are ready with the Garbage Mask around the areas of the footage that we want to keep in the shot, we will then Pre-Compose the layer with the name 'Keying Filter' and with the setting of 'Move all attributes into the new composition'. Now we are ready to apply the Keylight 1.2 effect onto the layer from the Effects and Pre-sets menu as this is the effect that we are going to use to pull out the green matte from the footage.

04          As the first step make sure that the 'Un-premultiply Result' option is checked which will prohibit the background colour to get mixed or blend in with the edges of the foreground object, as otherwise we might get a green haze around the edge of the object. The other important step is to set the colour that we want to get rid of from the 'Screen Colour' option. Select colour picker tool from the screen colour option and select the green colour close to the edges of our actor.

05          After the last step we got rid of the most part of the green screen at the back of the actor but if we look closely we will notice that there are still some parts in the background with the green screen information. So in order to get rid of those parts we will increase the value of ‘Screen Gain’ which actually controls the amount of screen colour being removed to make the screen matte. But increasing it too much will lead to the background showing through the foreground and edge detail will be destroyed. Therefore a better way of improving the matte is by using the Clip Black and White options.

06          Set the ‘Screen Matte’ option back to ‘100’ and switch to 'Combined Matte' inside the 'View' options in order to see the matte result. In this view black area denotes the transparent area on the footage while white area shows the colour channels. If we look closely we will notice that the background is not 100% black which doesn’t make the background completely transparent. So to improve the quality of our matte we want the whites to be white so that we can't see through it and we want the blacks to be black so that it becomes completely transparent.

07          Dive inside the 'Screen Matte' parameters inside the 'Key Light' options and play with the Clip Black and Clip White option in order to balance them for a better matte. We always need to be careful while working on the balance of Black and White as we may loose the detailing over the soft edges of the object like hair and fur. Increase the 'Clip Black' value to 25 in order to decrease the grey spots on the black area and decrease the 'Clip White' value to 85 in order to decrease them on white areas.

08          Switch back to ‘Final Result’ option from the ‘View’ parameter. Pulling out a default colour key from the footage might leave us with the background colour spill around the edges of the object. So in order to reduce the spilled colours on the foreground object we need to pick the normal colour pixels on it from the De-spill Bias Colour picker tool.

09          In case we end up destroying the edges of the foreground object, we can use the ‘Clip Rollback’ option to put back the lost details in the edges by putting up back the pixels comprising the edges. But for this example we will leave this value to 0 and will try to remove the black halo around the edges of the main actor with the help of Screen Shrink / Grow option. This option will enable us to shrink down the alpha in the screen matte to produce a black border less output as we reduce the value of Screen Shrink / Grow parameter down to ‘-1.0’.

10          Despot parameters help in coagulating similar regions on the matte, for example in this case we are getting black spots in the middle of the white matte of the actor which we can easily blend into the surrounding white areas with the help of these values. Increasing the ‘Screen Despot Black’ value to 2 will help us in removing those isolated spots of Black in the White matte of the actor. Similarly increasing Screen Deposit White value will remove the isolated spots of white in the background.

11          If we look closely at the arm of our actress we will notice a thin black line which we would like to soften up. We can always soften up the edge in one go but that might erode the pixels that we need to maintain the crispness on the edges. So in order to focus on a particular area we will isolate it with the help of mask and separate layers. As we are going to focus on the arm of the actress we will draw a garbage mask around it and animate it following its position on different frames.

12          In order to avoid the artefacts of using multiple layers always make sure to soften the edges of the masked layer by increasing the value of ‘Mask Feather’ option to 10. Select the ‘Keying Filter’ comp layer and duplicate it while renaming the duplicate as ‘Base Matte’. Dive inside the ‘Mask’ parameters of the composition and hit ‘Invert’ in order to invert the Mask and get the rest of the footage back that doesn’t need modifications.

13          Now if we zoom into the region where we had applied the feather we will notice that we are getting transparency issues. So in order to get rid of this we will create another copy of the composition with the name of ‘Core Matte’. Place it underneath the two compositions while deleting the mask from it in order to fill the areas with transparency issues.

14          But as we are going to deal with our black border problem we will be pulling out the dark edges from the Keying Filter composition, all we are going to see is the Core Matte composition underneath. This means that we need to shrink the edges of the ‘Core Matte’ composition more than the value of ‘Keying Filter’ composition. Therefore select the Core Matte comp and increase the value of ‘Screen Shrink Grow’ option to ‘-3’ and inside the Keying Filter comp increase the same value to ‘-2’ while also increasing the ‘Screen Softness’ value to ‘3’.

Share this: