Color / gradient ramp?

hi,

both blender and houdini have color / gradient ramps to map values from 0..1 to colors:

image

how would I do that in natron?

Hi, gradienting with multiple colors (>2) requires a bit calculation to use in Natron.
First of all, simple gradienting with 2 colors (using Ramp node from Draw->Ramp):


As you can see red flows into green.
Red point is at x = 0 (Point 0) and Green point is at x = 1080 (Point 1).

Then this is second ramp:


As you can see green flows into blue.
Green point is at x = 1080 (Point 0) and Blue point is at 1920 (Point 1).

Then we create a rectangle to copy the needed area (1080) for first ramp and paste it on top of the second ramp (Merge Copy Node should be used with mask arrow connected to Rectangle):


The final result is RGB Gradient with 3 key colors:


The main point is that the intermediate key color should be at the same location in the previous ramp’s Point 1 and the next ramp’s Point 0.

Hope this helps…

thanks for the explanation @okhostok

I probably should have give a better explanation of what I would like to achieve. basically, given a greyscale image I want to map intensity to color, using a gradient. like this:


how would you do that kind of thing in natron?

perhaps I’m thinking too much in terms of how blender / houdini work, but I couldn’t find a node that does that sort of mapping. from the sound of the name “ColorLookup” would have been my guess, but it looks like that has a different purpose.

It is not exactly what you are asking, but I think color multiplication might help you.
Given two images, first one grayscale image, next one is gradient.

You can use Merge->Merges->Multiply Node and connect two arrows (A and B) to both images. The result is this:

Another option is to make a grayscale ramp, for example using the Ramp or the Radial node.

Be careful about the alpha channel: set it to 1 both in the “from” and “to” to get the correct results.

Then, use a ColorLookup node to colorize that gray ramp. And read the doc for ColorLookup: