Color Management in VFX - Part III: Compositing
- The Understanding and Implementation in Nuke
This time I’d like to discuss how color shifts occur in compositing, particularly in Nuke. I will start from the basic workflow in traditional Linear-sRGB, then compare the difference with ACES. Basically, it’s an implementation of the concept discussed in the episode 1 of this color management series.
What we will mention in this article:
LINEAR-sRGB
Let’s take a look at the image. This is how arri native log format–LogC with Alexa Wide Gamut looks like. Nothing special, the image looks like being washed out and every pixel value is in the range 0–1. This is raw color without any view LUT applied.
Then let’s linearize the image from LogC space to linear-sRGB. Remember how to correctly linearize the plate?
- Gamma(Transfer Function) Correction
- Gamut Conversion
Note that gamut conversion is basically a color matrix and it must be applied to a linear input. It needs to be linearized first from LogC to Linear, then the color matrix can be applied to it from Alexa Wide Gamut to sRGB.
In this sample footage, the brightest value is around 3. So I just simply bring the gain up to 3 and the graph on the right side only shows the value range 0–1.
This is the interesting part.
Most of the time we’re usually working with sRGB view LUT. Image will not be affected by the view LUT and still stay linearly. The difference in the curve is the reason I’d like to explain why this sRGB view LUT is not suitable for viewing images.
In the linear-sRGB graph, we know the brightest value is around 3 and it is obviously not for viewing, like log space. The purposes are a bit different: the log space is to capture information as much as possible and keep the maximum capacity of editing; the linear space is to restore the scene at the moment the camera recorded linearly, and all the calculations will also be linear. These two spaces are not meant for artists to view.
In this case, we set the view LUT as sRGB, but the problem appears as well. Because the view LUTs in Nuke by default are just simple 1D LUTs, which only include the basic color transformation that may not accurately map the image for viewing.
The disadvantage of using sRGB default view LUT is all the value above 1 will be clamped that leaves the image with high contrast and over-saturation.
According to the result above, that’s why we need to view our log/linearized image via a 3D LUT.
In the last article we have discussed, 3D LUTs can handle more complicated color transformation and conversion from one colorspace to the other, and represent more accurate result. In the image above, we can see all the pixel values have been mapped properly into the range 0–1.
Usually cameras have their own native LUTs, which are from their manufactures, applied through on-set monitors, and they are the same LUTs that we use here to do tone-mapping. In other words, the look will be exactly the same as what you see on the on-set monitor, except for differences in monitors.
ACES
Now we know how does it work in the default nuke color management system. Let’s take a look to see the difference in ACES.
When bringing plates in Nuke with ACES, it will do gamma correction and gamut conversion at the same time. You don’t have to find reversed gamma curves and correct gamut color matrices to normalize plates manually. That is annoying because sometimes you have to waste time to find the conversions that don’t list on the Nuke colorspace dropdown menu.
The color from the image above is little bit weird because the primaries of ACEScg is AP1, and our sRGB monitor can’t represent it accurately but it is a linearized plate without any view LUT.
Now this is how ACES brings color consistency in the whole pipeline. Basically, all the input/output colorspaces and view LUTs are developed by the ACES team that is able to transform color from and to ACEScg-AP1 space.
Note that it actually converts colorspace into ACES2065–1-AP0 first then convert it again from ACES2065–1-AP0 to ACEScg-AP1, which is what we use in VFX pipeline.
Because the LUTs that ACES team developed all consist of 1D LUTs and 3D LUTs, so we can see the highlight in the image is much softer and gentler than the default sRGB view LUT. If productions use ACESproxy space on their on-set monitors, the color will be also be the same through ACES-Output-sRGB, and it will be the same as well in 3D software with OCIO color management.
The most significant features of this is that, regardless of the highest value, these ACES color transformations will always convert the colorspace into display spaces(display-referred space).
APPLY LUT in NUKE
I believe you’ve already grasped some ideas from the last article discussing LUTs. So I will just extend it a bit in Nuke.
The color between the two images below is identical.
As far I know, most compositors usually use the second way that normalizes the plate first, brings the log space to linear working space then puts a OCIOFileTransform node to apply LUT and finally convert back to LogC space.
The process behind the OCIOFileTransform is convert the gamma curve/transfer function(Linear) to specific transfer function(LogC), then convert back to linear curve after applying 3D LUT.
To view the color correctly, the gamma curve/transfer function needs to stay in LogC. So the final step is convert the linear back to LogC curve.
Note the gamut stays at Alexa Wide Gamut.
Let’s go back to the first way. Because the plate is interpreted in RAW, meaning it stays at LogC. OCIOFileTransform converts gamma curve/transfer function from linear to linear, that means gamma curve/transfer function doesn’t change, then converts to linear again after applying LUT.
If you can understand every steps in two ways, you will notice there is only one rule: Stay at the colorspace that the 3D LUT says it needs to convert from. In this examples above, the colorspaces of two ways before the OCIOFileTransform actually doing the action of applying LUT are all stay at Alexa Wide Gamut with LogC transfer function.
If you know the processes of every step, then you are able to keep the color consistency and manipulate it.
The second thing I want to discuss. This is the image in ACEScg-AP1 space. Normally we should view it with ACES-Output-sRGB LUT, but I use regular sRGB as example.
Sometimes compositors still need regular colorspace node to convert colorspaces. But ACES-Output-sRGB has s-curve that consists of 1D and 3D LUT, like I said earlier, to create “Filmic Look”, which is quite different compare to the regular 1D sRGB LUT.
Therefore, if you are viewing ACEScg-AP1 with regular sRGB LUT, well, it’s not wrong, but it may produce strange colors in the dark area and it’s not the standard way to view ACES footages. Be aware of that.