Pure contrast inversion

5mg3's icon

I have taken the image feed from the camera and turned it black and white using jit.rgb2luma and jit.op @op > @val 30.

However, I now need to use the opposite values, so I need to flip the black and white around. What is easiest and most efficient way of doing this?

I have tried jit.brcosa and looked at couple other methods, but the inverted image isn't perfect >> the white isn't as white..it is grainy with bits of black mixed, which wasnt present before the inversion. My entire patch depends on this being pure.

Can anyone suggest a better way of achieving this?

laserpilot's icon

you'll want to keep playing with the jit.op operations..think of your values as being 0 to 255 but you need a math operation or two to make that go the other way

you can also play with jit.scalebias and using negative numbers to get the inverse

5mg3's icon

Is there no object that just flips exactly what is shown?

Christopher Dobrian's icon
Max Patch
Copy patch and select New From Clipboard in Max.
5mg3's icon

Awesome cheers Christopher!