View Full Version : Poor Man's Difference Matte

 zuzzabuzz11 November 2003, 08:21 PMHowdy folks, I'm one of the new guys that took advantage of the Lightwave + DFX+ with Modules 1 and 4. Unfortunately, no module 2 (which has difference mask). I filmed some footage thinking I did have Difference mask, and got disappointed when I realized I didn't. Anyhoo. I've been trying to come up with an alternative. At first I tried stuff like Difference merges...which sort of works...but it produces an odd technicolor mask which doesn't always filter out stuff. Being kind of a white guy, and the sky here being kind of bright when i filmed, the difference between my pasty yellow skin and the pale blue sky doesn't really matter when using difference: when converted to grayscale, it's about the same value. So, i thought, why not find the distance between colors in color space, and use that for the alpha? Long story short, I used the Custom Tool (in Miscellaneous) and used the following for the Alpha Expression. 1-if((sqrt((r2-r1)*(r2-r1)+(g2-g1)*(g2-g1)+(b2-b1)*(b2-b1))-n1)
zuzzabuzz
11 November 2003, 05:15 PM
Forget that last bit, this one is paired down and not so odd:

1-if((sqrt((r2-r1)*(r2-r1)+(g2-g1)*(g2-g1)+(b2-b1)*(b2-b1)))<n1,1,0)

Just paste that in your Alpha expression box (and your r,g,b if you want), and use the Matte control and some garbage mattes to tweak it. Should cut down on time for some, i hope.

sample:
http://www.unm.edu/~buzzbuzz/dmFront.jpg
http://www.unm.edu/~buzzbuzz/dmBack.jpg