Feedback

What's your question?

By: Asked

linearizing a logarithmic curve

actually any non uniform curve besides the usual 2.2 ones Are there resources that describes the math/process without too much brain damage :P

back story: Plates in shake were to be used with the panalog-to-sRGB macro(view LUT). Getting the same plates into Nuke with the same look was painful.

i'm going a googlin for sure but would appreciate a mini tutorial from the folk here.If possible.

Thanks

b

Add comment viewed 820 times Latest activity 10 months ago

or Cancel

4 answers

  • 2

hugh_gid [ Editor ]

If you open up the macro in Shake, you should see something like a Lookup node, inside which you should be able to find the function...

Inside Nuke, you can define a new colour lookup. I don't have Nuke in front of me right now, so I can't actually describe how, but with a bit of tweaking, you should be able to take the same function from Shake and apply it to Nuke.

You'll want to be working in Linear in Nuke, and letting it do the Lin->sRGB at the viewer end.

NN comments
boomji_73
-

Thanks Hugh. That’s the first thing i did with the macro. Although what i really wanted was to quench my intellectual curiosity.How & why part ;) U-tube led me to some pretty heady stuff with finding the derivative of each point on the curve etc. i’ll hack on. Thanks so much for being a constant source of help to the community.

b

hugh_gid
-

How and why in terms of colour science, or the maths? You shouldn’t need to get into analyzing the curve, as the function should be quite clearly defined somewhere…

I’m not a colour scientist… I wish I knew more about that side of things (should get Piotr Stanczyk posting on here!)

or Cancel
  • 5

malcolmhumphreys

This took me a while to find out in the past, what your looking for are what called color 'transfer functions'. There are patchy docs all over the net, I have started to add some of these functions to openimageio lately.

http://svn.openimageio.org/oiio/trunk/src/libutil/colortransfer.cpp

You don't need to understand cpp just looks for the 'float operator() (float x)' lines and you can see the math involved for the forward and reverse transfer functions.

The main idea to grasp is that these transfer functions are a form of compression and decompression on the image signal (pixel values). Most transfer functions include some form of gamma (pow() function) with additional shaping of the curve at certain points and then upper and lower limits.

Most of the differences between these functions are to do with device that captures the data (the camera) and the device that displays it (a monitor).

This book has some pretty good info thats all in one place, even if it's mostly about tv centric than film but the ideas are pretty common. http://books.google.com.au/books?id=ra1lcAwgvq4C&lpg=PP1&dq=digital%20video%20and%20HDTV&pg=PP1#v=onepage&q=&f=false

I do want to add panalog to OIIO when I get a chance. Most of the info is here http://media.panavision.com/html/ADI/panalog.html if your interested.

To do a Panalog -> sRGB transfer you need to do run the pixels thru two transfer functions. 1. (Panalog -> Linear) 2. (Linear -> sRGB)

As some of these transfer functions are expensive and when they are strung together even more so, baking them down into a lut is a common optimization step.

Note. These transfer functions don't include anything to do with emulating one type of display on another display (making images on your monitor looking like the ones in the cinema). That's a more color scientist area that I'm not going to pretend I understand that well. :)

NN comments
boomji_73
-

Charle’s Poynton’s book has been ordered ;) thanks for the reference. we initially did refer to the panalog PDF and got something working. As i said my question is an academic one.Seeing & understanding the math gives me perverse pleasure :P

b

franssu_27
-

Charles Poynton is the best specialist for this stuff. I had the chance to follow one of his seminars, and I learned a lot from him. He has a knack for making stuff that nobody understands pretty clear. The book should be a real eye-opener.

or Cancel
  • 2

dbr [ Editor ]

http://www.cineon.com/conv_10to8bit.php (as PDF) explains the maths to do the linear-to-log and log-to-linear transformations.

The PDF also explains the reasoning behind the log curve

Panalog is the exact same transformation, just with different white and black reference points (which are explained in the link malcom posted)

For practical purposes, you'd be better linearising the data in the Read node, or using a Colorspace node (which has a Panalog transfer), and using a sRGB viewer LUT (as Hugh suggests)..

You could also bake the transformation into a LUT file using the CMS Test Pattern and a Generate LUT node, with a Colorspace node in-between (Panalog in, sRGB out)

NN comments
boomji_73
-

thanks for that one dbr

or Cancel
  • 2

franssu_27 [ Editor ]

You shouldn't have to do any maths to import Panalog plates into Nuke as the curve is implemented in the software. Simply put the Read node to Panalog, and you're good to go, as all the data will be transformed into linear. You just have to use the sRGB option in the viewer to see everything properly on your monitor. It is of course way different than using a Panalog-to-sRGB lut just after the read in shake, as in this case it means you're working your comp in sRGB space, not linear space.

NN comments
boomji_73
-

thanks for your input fran

or Cancel