recolor image with jit.gl.pix using a 3 color gradient mimic "tritone" efx

pelo's icon

Hello community,

I am trying to mimic the nice "tritone" color effect which is included in Adobe After effects. It colorises an image using a 3 color gradient.
See the attached image.

To colorize and image with two colors we simply can use the mix object.

Here is a patch, which is generating the 3 color gradient.
I am struggling with the jit.gl.pix.
I think what I need is using the gradient as a lookup table not as an input.

Perhaps someone has a hint for me,
Thanks in advance,
pelo

patch:

Max Patch
Copy patch and select New From Clipboard in Max.

Federico-AmazingMaxStuff's icon

Hey Pelo,

you should use the "jit.gradient.ui" object to build a 1 dimensional gradient.

Then in the jit.gl.pix you use the luminance of the input image as the index for the color in the gradient

Max Patch
Copy patch and select New From Clipboard in Max.

pelo's icon

Hello Frederico,

Thank you very much for your help!
This patch is much more elegant than mine :)
Will change it!

All the best,
Penelope