Forums > Jitter

Inverse colour

April 21, 2006 | 7:04 pm

Hi all,

Just wondering the best way to inverse the colours of a webcam feed coming
out of jit.qt.grab.

Thanks
Jonathan


April 21, 2006 | 7:12 pm

jit.op @op ~

~ is the bitwise complement operator meaning that it will take 255 and
make it 0 or for the 8-bit color value 00011100 it will produce
11100011.

best,
wes


April 21, 2006 | 7:25 pm

> jit.op @op ~

Yes, that’s probably the fastest, but just for reference of other
ways to handle color processing check out the following.

or
jit.op @op !- @val 1.
or
jit.scalebias @bias 1. @scale -1.
or
jit.charmap

-Joshua


April 21, 2006 | 7:37 pm

Thanks Wes for the quick reply, knew it would be something straight forward!

Cheers also Joshua for the pointers. I’ve got a deadline in a few weeks, and
am on a steep learning curve with this stuff…expect a few more newb
questions in the near future! ;-)

Jonathan


Viewing 4 posts - 1 through 4 (of 4 total)