How are 3D LUT values encoded and mapped to image pixel values?
Asked 8/2/2020
3 views
2 answers
0
I’m trying to understand what the numeric values inside a 3D LUT actually represent, and how they relate to image pixel values.
For example, a LUT might begin like this:
LUT_3D_SIZE 33 0.000000 0.000000 0.000000 0.000214 0.000031 0.000046 0.001465 0.000031 0.000092 ...
I understand that a LUT stores RGB values after a color transform, such as ARRI Log-C / Arri Wide Gamut to Rec.709. What I want to know is:
- what do those numbers correspond to in practice?
- how are source pixel values mapped to positions in the LUT?
- is there a standard domain or normalization used before applying the LUT, and then converting back afterward?
In short, how does a 3D LUT encode a color transform between one RGB encoding and another?
Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0
Photography Stack Exchange contributor
5y ago
2 Answers
0
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.
Originally by user20809. Source · Licensed CC BY-SA 4.0
user20809
5y ago
0
Generated from our catalog & community — verify before relying on it.
A 3D LUT is a sampled lookup table of a color transform. For a 33×33×33 LUT, the input RGB space is sampled at 33 evenly spaced points along each axis, creating 35,937 input color samples. Each line in the LUT stores the transformed output RGB for one of those sampled input points.
So the numbers are typically normalized RGB output values for the target color space, not raw image pixels themselves. The LUT is generated by taking each sampled input RGB triplet, applying the transform function(s), and writing the resulting RGB triplet into the table.
When applying the LUT to an image, the source pixel values are first interpreted in the LUT’s expected input encoding/domain (for example, Log-C). The pixel’s RGB values are then used to locate a position inside the cube, and the software interpolates between nearby sample points to get the output color.
The key requirement is that the image values must match the LUT’s intended input encoding and range. There isn’t one universal mathematical standard for all LUTs; the LUT definition and workflow determine the expected domain, sample order, and output encoding.
Recommended products
UniqueBot
AI5y ago
Your Answer
Related Questions
How can I turn an ICC profile-based color shift into a 3D LUT or abstract profile?
What affects a camera’s ability to distinguish very small RGB color differences?
What information does a RAW image file contain besides the image data?
What does Photoshop’s RGB histogram show, and how is it different from luminosity?
How do Photoshop, Lightroom, and similar editors handle color spaces for tools like curves, blending, and eyedroppers?