different background in matrix with expr

matteopennese's icon

I suppose it's a very stupid question for jitter masters,
but… how can I change the background from black to another color in such a matrix?

Many thanks

mat

3919.DifferentBg.maxpat
Max Patch
Tobias Rosenberger's icon

jit.expr fills your matrix based on a formula. in this case you have a one plane matrix only: so if you have black its just the number "0", if you have pure white it is "255".

If you want to replace all the black pixels (= zeros), you could first transform the matrix in a 4 plane matrix (jit.matrix 4 char 200 100), then you could use f.e. jit.chromakey to replace black with another color, or you could use jit.op...

matteopennese's icon

Thank you very much.

So, can't I create the same effect with a different 'color background' inside 'jit.expr' (changing, of course the matrix to 4 planes)? I tried to change the expression, but no success…

mat

Rob Ramirez's icon
Max Patch
Copy patch and select New From Clipboard in Max.

since you are simply trying to replace black (or 0), as simple [ jit.op @op + ] will do the trick.
one way of many:

matteopennese's icon

Thank you Robert,

now it's clearer.