Photography Asked by hdcdigi on March 4, 2021
I am looking into the colour science regarding lookup tables, and their application to images.
I am trying to find out what the values within the LUT actually represent.
LUT_3D_SIZE 33
0.000000 0.000000 0.000000
0.000214 0.000031 0.000046
0.001465 0.000031 0.000092
0.004562 0.000000 0.000031
0.010178 0.000000 0.000000
0.018982 0.000000 0.000000
0.031540 0.000000 0.000000
0.048173 0.000000 0.000000
0.068177 0.000000 0.000000
0.087922 0.000000 0.000000
...
...
...
I know these values are numerical representations of RGB values, post mathematical transform.
For example, to correctly view an an image in Log-C(ArriWideGamut) we need to use a transform LUT ArriLogC->Rec709. A mathematical function is applied to transform the image into a viewable colour space.
What I want to know is how are the numbers in the LUT encoded in relation to the actual pixel values that make up the image? Is there a mathematical standard that pixel values must be converted to in order to apply the transform function and vice versa once the LUT is applied?
The LUT evaluates a given colour transformation function or series of colour transformation function over a given domain to produce the resulting range of colour values.
At the simplest, to generate your ARRI Log-C to BT.709 3D LUT, one would start by producing a cube/table of linearly spaced RGB samples according to the precision required, commonly 33 (or even 65 samples) per cube dimension. The resulting linear cube would maybe have a 4D shape as follows: (33, 33, 33, 3), i.e. 35937 RGB samples. Then the ARRI Log-C to BT.709 function needs to be applied onto the cube RGB samples and the LUT is ready to use. Importantly, the order of the samples is what determines how the cube should be indexed. Now, with a given ARRI Log-C input value, it simply a matter of calculating its index in the cube to find the corresponding BT.709 output value.
Things get a bit more complicated if the ARRI Log-C input value is between multiple indices, which happens systematically, then interpolation is required, 3D LUT are typically interpolated with Trilinear Interpolation or Tetrahedral Interpolation.
Paul Bourke has an easy to grasp Trilinear Interpolation article. If you are Python and Numpy savvy, we have vectorised Trilinear and Tetrahedral Interpolation algorithms in Colour.
Correct answer by Kel Solaar on March 4, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP