You're blocking ads, which pay for BlenderNation. Read about other ways to support us.

Videotutorial: Color Difference Keying with Nodes


color-difference-keying.jpgIf you're not satisfied with Blender's built-in chroma-keying notes or if you'd like to have more control over them, then check out this 11-minute videotutorial on color difference keying by Dave Weese.

Update (26/04/08): this tutorial is no longer available; please read 'Keying Hair in Blender' instead.

Dave writes:

This short video explains color difference keying - a green-screen matte extraction technique that is arguably the most common and effective keying technique used in feature film work for the past ten years - much, much more effective and easy than chroma-keying in most cases. It is the basic mechanism operating "under the hood" in expensive keyers like Ultimatte.

It also explains one of the most effective spill suppression techniques, and reveals one of the untold secrets of good matte work - edge blending. Anyone who has struggled with chroma-keying will be glad to learn this information.

Dave Weese

I LOVE this video!! It breaks many of the guidelines I wrote about before: the pace is insane, Dave's mouse is flying across the screen, images zoom in and out - better fasten your seatbelts before playing this one! (Halfway down the tutorial, Dave even comments 'I'm gonna go fast, so here we go!', which is like shifting from fourth into fifth gear ;-) At the same time, his presentation is flawless (did you really record all that in one take, Dave?), he absolutely knows what he's talking about and the enthusiasm is just pouring out of the screen. I'm 100% sure that if he would produce a nice training DVD it would sell like crazy.

On a final note, I do feel a bit sorry for the girl in the shot that Dave used; it's not a very flattering picture :)

About the Author

Avatar image for Bart Veldhuizen
Bart Veldhuizen

I have a LONG history with Blender - I wrote some of the earliest Blender tutorials, worked for Not a Number and helped run the crowdfunding campaign that open sourced Blender (the first one on the internet!). I founded BlenderNation in 2006 and have been editing it every single day since then ;-) I also run the Blender Artists forum and I'm Head of Community at Sketchfab.


  1. Excellent tutorial with extremely useful information, BUT: Pleeeease speak slower! You're not in a hurry, none is behind you. It's no need to break speed records ("I can explain radiosity in five secs!") *g* Bandwidth is not a big issue these days, and most people probably have an additional 4-5 minutes.

    But I really enjoyed it. I still hope, Blender will be able to replace Shake one day... My personal wishlist for Blenders compositing engine is:

    - top to bottom network (I think those are more intuitive and tend to be less chaotic)
    - support mask inputs
    - capsules (grouping many nodes into one black-box-like super node)
    - export and import those capsules (so you don't have to rebuild networks all the time)
    - support for AE plugins (imagine all the possibilities....!)
    - more nodes; especially for easy tasks (invert, xor, and, or, overlay timecode)

    Hope to see them one day integrated in Blender.

    So far.

  2. @Sparkus:

    "- capsules (grouping many nodes into one black-box-like super node)"

    Do you mean groups? You can already do that: select all the nodes you need and press CTRL+G.

  3. @Bart:

    Oh great! I didn't check it out... I think it would be great if you could export those groups. Take this color difference key as an example. Wouldn't it be great to offer an easy to use download. Of course it's better to implement it by yourself for educational reasons... But not everyone has the time. Imagine a submenu in the node editor menu where your favorite "groups" are listed, so you can automate everyday tasks like own color grades, custom edge detects, custom color keys... This would be extremely handy!

  4. Sparkus: You can import node groups into other files by doing append and browsing for NodeTrees. Then they just appear in the Groups menu. It would of course be nice to have a system by which you could assign various files to be loaded at startup as a library system though (no the .B.blend isn't the same).

  5. The americans seem to like this sterotypic german blonde maide. Allthough it has nothng to do with reality, it can be very funy. You get some examples, if you seach "Unpimp my ride" in google. Sorry for spamming :-)

  6. Yeah, I should note too, I just watched the video and it was great. I didn't find it too fast at all, though of course it's not for beginners. That's great though, not everyone is just starting out! There needs to be more learning material that's not aimed at new users, otherwise everyone will be beginners forever.

  7. Great video ! I'm not english speaking but I can follow the essential.
    It's clear that his enthusiasm is communicative.

    Did you notice ? Nothing to do with 3D. Blender is a very complete product ! ;-)

  8. Superb use of the node system. I think this is one of the best techniques for doing 'green screen' that I've seen in the open source world.

    And, of course, thanks for sharing.

  9. Just a side note, the first part of his technique is what the channel difference node is doing, with the exception that it takes the Max of the either the red or blue channel (if keying the Green channel in RGB color space). If you're not seeing what you should (ie it's broken), please let me know and I'll fix it for you. That being said, this was an great tutorial, you should definitely do more.



    PS. Sparkus, the mask inputs for some nodes are next on my list after the node refactor (which I'm mostly done with).

  10. Has anyone being able to fully download the video from the link posted before. As I've tried but each time I tried in a download manager it got close to 99% and then started again from the beginning ,deleting what had being downloaded before. And when I tried Firefox's' built in manager it only got to 39mb before saying it was complete and was thus incomplete.

  11. This is one of the best tutorials I ever saw which are quite some.
    Material of this high quality is much, much appreciated.
    Thanx a lot, Dave!

  12. Hmmmmm....Bart, if you're really, really, 100% sure, I may just get to work on a DVD! :)

    I guess I could have slowed down a little bit! Too much coffee that day, I guess.

  13. I can assure you the girl in the tute was not at all pleased either! But she is a good sport, and I told her I would try to turn all the blenderheads on to her music video when it is done as compensation for her utter and complete humiliation. :)

  14. Great tutorial so far - it just randomly stopped after about 2-3 minutes. Would the same technique be useful for Bluescreen, but would you just subtract the Red from the Blue instead?

    Also why is this method better than the Difference Key node, as Bob said it uses the same method?

  15. Thank you very much for posting this. I have always had trouble with keying with plugins. This gives me so much more control.

  16. Joel,

    I'll try and answer for Dave (pleaes correct me if I'm wrong), but this method is "better" than using the channel difference node because it allows control over the process at every step. The trade off is speed.



  17. Blue minus red works very well too. I have tried the color difference node and the other keying nodes, and I have a hard time getting good results. As I say in the video, color difference keying is a very old and tried and true technique in the film world.

    Bob is quite correct! Taking the max of the blue or red and subtracting THAT from green is actually the better method, but I have found if the greenscreen is reasonably well lit, it's a step that's seldom needed to get a rough matte.

    Questions for Bob : Regarding the difference node, if it's using channels under the hood as I did, what is the purpose of having a selectable key color? Also the nodes all seem to do good job of deciding what should be transparent. Where I've had trouble is having control over edge quality. I'd love to talk about the algorithms you used.


  18. Wow. Fast and furious! Great tutorial! This is one that just about everyone should see! Well done, Dave. Well done.

  19. Dave, I can answer for Bob - it's not the difference key node, it's the channel key node. I can also confirm that it gives pretty good results, I used it recently at work doing some keying for a TVC, and it performed well. I do agree with you that edge quality can be a bit hit or miss, and I do like your method for getting rid of the spill, it's simple and really effective! Maybe that would be good to add to the node as an option.

  20. Boy will I have uses for this next spring!

    Fantastic to see this, a really effective demo of some of the most useful features of Blender for combining live action with CGI. Since that's something I want to do in the future on a fairly ambitious scale, I am really happy to see this. Never used the Blender compositor, but after seeing this I shall be looking at it more closely.

  21. Dave,

    I'd love to talk about better ways to key and remove color spill. I'm usually in IRC (#blendercoders) . To answer your question, the difference key uses the key color (from color picker) and determines the distance in 3-dimensional color space from that color to the pixel in question to determine if it is transparent/opaque/something inbetween. The channel keyer uses the green-MAX(red,blue) algorithm we've alsready discussed. Hope to see you in IRC. You should do more videos when you have a chance.



  22. I was happy to have a nice fast tutorial. I would love more fast tutorials. It really strengthens me, and I'm glad you weren't afraid to teach the Blender community like a bunch of babies. Bravo!

  23. Scratch that.. I'm dyslexic. I mean... you weren't afraid to teach the Blender community like grown-ups, instead of as a bunch of babies.

    Durrr.. Maybe I should go back to grade school for english!

  24. Yes Dave,

    I'm with TKR in seeing if you would share the .blend file?
    there is a tricky compositing project coming up that
    could benefit from this approach.

    thanks agian.

  25. um.. i have the latest blender build... 2.45
    and I don't get any of those options (MATTE,Distort,filter)
    I only have

    anyone help me?

Leave A Reply

To add a profile picture to your message, register your email address with To protect your email address, create an account on BlenderNation and log in when posting a message.