Color Management in VFX - Part II: LUT
- Decryption of Look Up Table
If you are an artist you probably already hear this thing a lot. Your lead just sends you a .cube file and tell you to view your image with this LUT. But really, do you know what a LUT is? Do you have to know it?
Well, you don’t have to. But once you understand how it works, it will definitely help you build the correct colors.
Another reason I want to talk about LUTs is because it will be much easier when we dive into different sections like ACES or view transformations after you have a basic understanding of this.
Ifyou are an artist you probably already hear this thing a lot. Your lead just send you a .cube file and tell you to view your image with this LUT. But really, do you know what is LUT? Do you have to know what the LUT is?
Well, you don’t have to. But once you understand how it works, it will definitely help you build the correct color.
The other reason I want to talk about LUT is because it will be much easier when we go into different sections like ACES or view transformation after you have the rough understanding of this.
Ifyou are an artist you probably already hear this thing a lot. Your lead just send you a .cube file and tell you to view your image with this LUT. But really, do you know what is LUT? Do you have to know what the LUT is?
Well, you don’t have to. But once you understand how it works, it will definitely help you build the correct color.
The other reason I want to talk about LUT is because it will be much easier when we go into different sections like ACES or view transformation after you have the rough understanding of this.
Ifyou are an artist you probably already hear this thing a lot. Your lead just send you a .cube file and tell you to view your image with this LUT. But really, do you know what is LUT? Do you have to know what the LUT is?
Well, you don’t have to. But once you understand how it works, it will definitely help you build the correct color.
The other reason I want to talk about LUT is because it will be much easier when we go into different sections like ACES or view transformation after you have the rough understanding of this.
What we will mention in this article:
WHAT IS LUT?
This is the short definition from Sony:
A LUT (Look-Up-Table) is simply a table of fixed numerical values that can be applied to video to alter its look. It can change an image’s contrast or colour or both. -Sony
Think like this way: a box has a formula inside that it can take whatever you give to it and spit out through the formula. And thanks to this magical box, then we are able to represent the color that we want to describe.
We can categorize LUTs into two types — Technical LUT and Creative LUT.
Technical LUTs: or Neutral LUTs, are used to convert the camera’s native spaces to specific display spaces, like LogC to Rec.709, or REDlogFilm to DCI-P3. These LUTs are usually provided by the camera manufactures.
Creative LUTs: which is more artistic to create a visual look or style.
To understand how color flow in different colorspaces and the relationships with displays, we will only discuss the technical LUT in this article.
To delve deeper in this, there are two types of technical LUTs: 1D LUTs and 3D LUTs.
1D LUT
1D LUT is an invertible color transformation that only affects individual red, green and blue channel, which represent one dimension of a 3D color cube. It can adjust contrast, brightness, black/white level, pretty much like what you can do in photoshop with “black/white”, “levels”, “curves” and “exposure”.
It can be used in gamma correction when linearizing the transfer function, or bringing the linear values into the range 0–1 which the image can then apply a 3D LUT to, we will talk about this later.
This is the example of how a 1D LUT looks like:
This is a linear to Rec.709 1D LUT from OCIO configuration. You can see it in the example, now it only shows 17 points though, is indicating to a certain output value by the given input value. The length 4096 means it is a 2¹² = 12-bit LUT, has 4096 indices for all 3 channels that contains 4096³ = 68.7 billion colors.
3D LUT
A 3D LUT, as the name suggests, is a 3 dimensional LUT that describes color transformation more precisely. It can do color transformation more complicated than 1D LUT such as hue and saturation, because when one channel is modified then the rest channels will also be affected relatively.
That said, if there is a 100% accurate 3D LUT, it should have 256 indices for each dimension to transform 16.7 million colors, one input only for one output. Unfortunately, this LUT file can become very large and can be difficult for computer to handle.
In order to make the process easier and faster, the table has to be downscaled. The most commonly used ones are 17x17x17 and 33x33x33 calibrated color data points, up to 65x65x65. The higher the color data points, the more accurate the interpolated point between the adjacent calibrated points, but that also increases the memory storage.
Let’s take a look at a 3D LUT from Alexa LogC to Rec.709.
The size 65 means it is a 65x65x65 3D LUT contains 35,937 points. Most of 3D LUTs expect the input value in the range 0–1 domain and the output value will also be in the range 0–1. It’s worth noting that there is no way to know which colorspace this 3D LUT is converting from and to, so it is important to name the file clearly.
SHAPER LUT (PRELUT)
Because 3D LUTs only take the values in the range 0–1 that can cause clamping for linear images. A smaller LUT, which is a 1D LUT only affects one dimension without changing hue or saturation, maps the high dynamic value to the display range 0–1 before applying 3D LUT.
It is used for the applications are not floating point supported.
The example is OCIO ACEScg to Rec.709 LUT for Maya. It’s usually bind with a 3D LUT as you can see above, a 12-bit 1D shaper LUT is listed ahead of a 65x65x65 3D LUT which maps a 0–1 range to Rec.709 space.
The different format of LUT has their own header. In this case the header is written as “CSPLUTV100”.
One last thing, many people actually don’t know what is the correct color even after applying LUT. Always check the input colorspace to see if it is exactly the same as the colorspace that LUT tells you to convert from.
Let me take the LogC to Rec.709 as an example again, the result color should be identical as the color shows on-set. In some applications such as Nuke, the operation for applying LUT sometime converts the colorspace back to linear space and that will not show the color correctly. Make sure the input colorspace stays at the Alexa wide gamut with LogC transfer function, then apply the LUT.