Colour Science (Was: Blender Filmic)

This is a relatively easy one. Rather, this is a very deep hole that is easy to fall into to begin…

As kesonmis has pointed out many times, RGB is relative. That means a few things from “How do I transform my data?”

First, let’s revisit what the ISO 22028-1 Standard states as required for an RGB colour space:

  • Explicit definition of the RGB chromaticities. “What colour, using an absolute model, are our red, green, and blue lights?”
  • A clearly defined transfer function. “What is the intensity scale and range for the RGB data value?”
  • White point or achromatic colour. “What is the colour that will appear neutral, typically when red equals green equals blue?”

What the above tells us is that we can’t look at any RGB triplet and deduce the intensity scale, the colour of the lights referenced, nor the colour of the achromatic value from the data alone. The data values alone are utterly meaningless without further information.

So where to start? Know that you can’t apply a transform, via a LUT, formula, or any means, without knowing the above three pieces of information.

Once you know those three, that allows you to define the parameters of your input and output, and create a transformation.

So best advice is, as I frequently restate, to take baby steps. What would a baby step look like in this instance? I would strongly advise you to help yourself and likely a huge number of people in this forum, to begin with your own custom looks. That is, now that you know and use the CDL, learn how to bake a CDL transform into a custom look.

Start by taking a reasonably good mixed colour image render. Slug in a CDL node and grade it using a few tweaks of values. Now record those three numbers.

As you may or may not know, OCIO has built in support for the CDL! This means you should be able to open up the config.ocio file, add your own CDL transform with your own values, and then reuse that new look in any scene you wish! Because we already know that our data is REC.709 / sRGB coloured primaries direct from a render, we also know the white point is well defined D65, and we know we are in scene referred linear ratios, we can apply a simple CDL in precisely the same place our node is affecting the data and (hopefully) get a perfectly identical result… With a little blood, sweat, and tears likely due to a typo or a small bit of learning pain. :wink:

How might you begin this baby step? Assuming you have your three values, and a good TIFF of the image output for reference:

  • Open up the config.ocio file and duplicate the Filmic Log Encoding Base stanza from Filmic. The “stanza” is the entire indented definition. Rename the name to “TestingCDL”.
  • Find the proper syntax for a CDL transform via the OCIO documentation. Add the line as the first[/] entry in the children of the “from_reference” definition. Insert your own values.
  • Watch your whitespace as OCIO is [i]extremely fussy, and save it.

You should be able to load your EXR render, select the horrifically labeled “View as Render” option in the UV Image Editor, and apply your custom CDL modified view. It should be perfectly 1:1 with your original CDL node.

When you succeed, you are one step closer to defining your own custom look via a similar approach.

For additional knowledge, find out what happens:

  • If you place the transform in a different position in the transform chain?
  • If you feed the exact same image rendered as a display referred file such as an sRGB TIFF to the exact same view?

If any or all of this post is gobblygook to you, please post and I will do my best to offer further guidance or explanations. Good luck.