Removing Single Color

Ok, so I’m trying to learn how to do green screen stuff basically. So the first step in this was to learn how to remove green from an image. I sorta have that working but am running into a snag. There is a green border that remains around everything after I removed the green. Why is this happening?

And yes I know in this particular image it would be easier to go into photoshop and remove the green or just render the sky with alpha 0 but thats not the point.

Attached is my node setup and the resulting image


If you search the forums for “green screen” you will find a couple of useful threads like

Both those techniques use blender’s own greenscreening nodes, which are very random. If you wan to learn a way to greenscreen from scratch, go here:
just click on Training/Tutorials on the sidebar and The Ultimate Keyer is what you want.