Colouring a greyscale video

John Liu's icon

Hi guys,
I'm planning to add some colours into a greyscale live video. Is there any way I can do it? Many thanks!
John

tdc's icon

Hi John, you should illustrate your question a little more to allow others to understand your intention.

John Liu's icon

Hi,
Actually I’m trying to make a patcher which the frequency/pitch of the audio input triggers the display of different colors (e.g. an A note triggers a blue color). I’ve built this part already. Then, I want to add the color into the video output, which is from the live camera, so that the color changing can appear on the live video. My ultimate goal is to change the color only to the face detected in the live video, but that’s a bit beyond my capacity for now. Therefore, I’m trying to add the color into the live video first as a color filter. Does anyone have any idea?

thanks!
John

Floating Point's icon

this is one way (there's probably simpler ways of doing it):

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

Rob Ramirez's icon

here's 2 more ways using vizzie modules, which will be more performant then the matrix solution for larger dimension video input:

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

John Liu's icon

Thanks you guys! Your patchers are really awesome! I will try to modify a bit to fit in my current project and perhaps I will show you guys when it's done! Thanks again!

Rob Ramirez's icon

another technique i just remembered: you can use the colorize cosine function of jit.gl.bfg with the basis set to input.distorted and distortion set to 0:

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

this can obviously be further modified via the vizzie patchers in the previous reply.

Gregory Taylor's icon

Whoa. Now that's a solution I didn't see coming....

You rule, Rob.