Normalizing color range in Nuke

If you have worked with a little bit vector math or played around with cartesian coordinate system you are familiar with the concept of normalising a value. What it really means is to make a range fit inside the range 0 – 1. This is done to be able to scale or transform the range.

I am currently learning Nuke and looking deeper into the math behind compositing. After all colors are really just numbers though more fun to look at (most of the time)

The thing that made me write this post was the realization that when you match black and white points the first step is to normalize the b&w points of the image to be corrected. What this means is that we shift the darkest pixel in the image to be perfect black (0) and the brightest to perfect white (1). When we have the range between 0 – 1 we can then push this b&w points to match the b&w points of the background image.

To do this we use the curveTool node in Nuke. We connect the node to the image we wish to normalize. If the image is premultiplied we insert a bg of 50 % grey so that the solid black pixels will not be part of the “equation”. We set the Curve type to Max luma pixel an hit Go! In the maxLumaData tab we will find the information we are looking for. We also get a viewport display of where the pixels are located.

The next step is to add a grade node to the image we want to normalize. Then LMB drag and drop from the Minimum Luma (of the curveTool MaxLumaData tab) to the grade nodes Black point. Repeat for the Maximun Luma to the white point.

Voila ! The result is an image where the colors of each channel spans from 0 – 1.

The next step is to set the absolute black of the image we are correcting to the lowest color value of the image we are using as a reference. We do this using a CurvTool node and repeat the process described above. Then we LMB drag n drop from the Max Luma to the Gain of the grade node and the Min Luma to the lift.

Leave a Reply

Your email address will not be published. Please enter your name, email and a comment.

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>