Q: I need a "Channel Combiner" node
I'm currently working through Steve Wright's book, Digital Compositing for Film and Video. He pitches this book as "application agnostic" - meaning you should be able to apply the techniques to most any compositing packages: Shake, AE, Digital Fusion, Nuke, etc. Steve has moved on to using Nuke nowadays but back when this book came out he was using Shake. So, to best play along, I've been using Shake to follow the book. (I had been wanting a Shake refresher anyway, as I haven't played with it in a couple of years.)
So anyway, there's a section that talks about despilling, or more precisely, in the exercise I'm hung on, UNspilling. I have most of his nodes figured out, except for the end. He's basically suggesting that you break out the individual color channels into separate nodes, perform some operations, then re-assemble the RGB channels into one image again. This last part has me stumped!
What I need is a node that basically says, "take the Red channel from this image, take the Green channel from this image, and take the Blue channel from this image". I just cannot figure it out. I'm pretty certain all my prior nodes are fine. But this final channel summing node is alluding me. A simple diagram I mocked up might look like this: (Using Mr. Wright's supplied images here.)

I found this article that makes explicit mention of the magical unspill node tree. In fact, they've included a diagram of their tree. However, it's so small I can't make much out of it.

Hopefully someone can help me unravel the final piece to this puzzle. I've killed a lot of time trying different combinations of other nodes. All to no avail.
FWIW, here's a copy/paste of my current script as exists: (minus the actual 'greenscreen.tif' file that I'm using to work through the example.)
greenscreen = SFileIn("./greenscreen.1-48#.tif",
"Auto", 0, 0, "v1.1", "0", "");
blue = ColorX(greenscreen, b, b, b, a, z);
green = ColorX(greenscreen, g, g, g, a, z);
red = ColorX(greenscreen, r, r, r, a, z);
average_RB = Mix(red, blue, 1, 50, "rgba");
spillmap = ISub(green, average_RB, 1, 100);
blue2 = ColorX(spillmap, b, b, b, a, z);
green2 = ColorX(spillmap, g, g, g, a, z);
red2 = ColorX(spillmap, r, r, r, a, z);
blue_scale = Lookup(blue2, JSplineV(x,1,0@0,1@1), JSplineV(x,1,0@0,1@1),
JSplineV(x,1,0@0,1@0.4), JSplineV(x,1,0@0,1@1));
green_scale = Lookup(green2, JSplineV(x,1,0@0,1@1), JSplineV(x,1,0@0,1@0.7),
JSplineV(x,1,0@0,1@1), JSplineV(x,1,0@0,1@1));
red_scale = Lookup(red2, JSplineV(x,1,0@0,1@0.25), JSplineV(x,1,0@0,1@1),
JSplineV(x,1,0@0,1@1), JSplineV(x,1,0@0,1@1));
IAdd1 = IAdd(blue_scale, blue, 1, 100);
IAdd2 = IAdd(red_scale, red, 1, 100);
ISub3 = ISub(green, green_scale, 1, 100);
Ignore(blue_scale);
Ignore(red_scale);
Ignore(green_scale);
Hopefully what I'm looking for makes sense to someone out there.
So anyway, there's a section that talks about despilling, or more precisely, in the exercise I'm hung on, UNspilling. I have most of his nodes figured out, except for the end. He's basically suggesting that you break out the individual color channels into separate nodes, perform some operations, then re-assemble the RGB channels into one image again. This last part has me stumped!
What I need is a node that basically says, "take the Red channel from this image, take the Green channel from this image, and take the Blue channel from this image". I just cannot figure it out. I'm pretty certain all my prior nodes are fine. But this final channel summing node is alluding me. A simple diagram I mocked up might look like this: (Using Mr. Wright's supplied images here.)

I found this article that makes explicit mention of the magical unspill node tree. In fact, they've included a diagram of their tree. However, it's so small I can't make much out of it.

Hopefully someone can help me unravel the final piece to this puzzle. I've killed a lot of time trying different combinations of other nodes. All to no avail.
FWIW, here's a copy/paste of my current script as exists: (minus the actual 'greenscreen.tif' file that I'm using to work through the example.)
greenscreen = SFileIn("./greenscreen.1-48#.tif",
"Auto", 0, 0, "v1.1", "0", "");
blue = ColorX(greenscreen, b, b, b, a, z);
green = ColorX(greenscreen, g, g, g, a, z);
red = ColorX(greenscreen, r, r, r, a, z);
average_RB = Mix(red, blue, 1, 50, "rgba");
spillmap = ISub(green, average_RB, 1, 100);
blue2 = ColorX(spillmap, b, b, b, a, z);
green2 = ColorX(spillmap, g, g, g, a, z);
red2 = ColorX(spillmap, r, r, r, a, z);
blue_scale = Lookup(blue2, JSplineV(x,1,0@0,1@1), JSplineV(x,1,0@0,1@1),
JSplineV(x,1,0@0,1@0.4), JSplineV(x,1,0@0,1@1));
green_scale = Lookup(green2, JSplineV(x,1,0@0,1@1), JSplineV(x,1,0@0,1@0.7),
JSplineV(x,1,0@0,1@1), JSplineV(x,1,0@0,1@1));
red_scale = Lookup(red2, JSplineV(x,1,0@0,1@0.25), JSplineV(x,1,0@0,1@1),
JSplineV(x,1,0@0,1@1), JSplineV(x,1,0@0,1@1));
IAdd1 = IAdd(blue_scale, blue, 1, 100);
IAdd2 = IAdd(red_scale, red, 1, 100);
ISub3 = ISub(green, green_scale, 1, 100);
Ignore(blue_scale);
Ignore(red_scale);
Ignore(green_scale);
Hopefully what I'm looking for makes sense to someone out there.
Mac Pro 2.8 8-core, 12" Powerbook G4, Mac OS X (10.5.8)
Posted on Jul 31, 2010 5:11 PM
by stuckfootage,Solvedanswer
I recognize that cute greenscreen girl! Steve Wright's book is excellent.
To do a "color combiner", you just need two copy nodes.
Text1 = Text(1920, 1080, 1, "Red", "Utopia Regular", 300,
xFontScale/GetDefaultAspect(), 1, width/2, height/2, 0, 2,
2, 1, 1, 1, 1, 0, 0, 0, 45, 0, 1);
Text2 = Text(1920, 1080, 1, "Green", "Utopia Regular", 300,
xFontScale/GetDefaultAspect(), 1, width/2, height/2, 0, 2,
2, 1, 1, 1, 1, 0, 0, 0, 45, 0, 1);
Text3 = Text(1920, 1080, 1, "Blue", "Utopia Regular", 300,
xFontScale/GetDefaultAspect(), 1, width/2, height/2, 0, 2,
2, 1, 1, 1, 1, 0, 0, 0, 45, 0, 1);
Copy1 = Copy(Text1, Text2, 1, "gb", 0);
Copy2 = Copy(Copy1, Text3, 1, "b", 0);
To do a "color combiner", you just need two copy nodes.
Text1 = Text(1920, 1080, 1, "Red", "Utopia Regular", 300,
xFontScale/GetDefaultAspect(), 1, width/2, height/2, 0, 2,
2, 1, 1, 1, 1, 0, 0, 0, 45, 0, 1);
Text2 = Text(1920, 1080, 1, "Green", "Utopia Regular", 300,
xFontScale/GetDefaultAspect(), 1, width/2, height/2, 0, 2,
2, 1, 1, 1, 1, 0, 0, 0, 45, 0, 1);
Text3 = Text(1920, 1080, 1, "Blue", "Utopia Regular", 300,
xFontScale/GetDefaultAspect(), 1, width/2, height/2, 0, 2,
2, 1, 1, 1, 1, 0, 0, 0, 45, 0, 1);
Copy1 = Copy(Text1, Text2, 1, "gb", 0);
Copy2 = Copy(Copy1, Text3, 1, "b", 0);
Posted on Jul 31, 2010 9:38 PM
