Exposure and White Balance with CDL and Log Signals

log-exposure-white-balance-silverstack-livegrade

“It’s now ten years of digital cinematography, and all we have is ASC CDL” – that’s what sometimes comes to mind when thinking about color metadata and interoperability between systems. The ASC CDL seems limited with its ten parameters (three channels per “Offset”, “Power”, and “Slope” plus one saturation). Still, the designers of ASC CDL made some excellent decisions that make the ASC CDL quite powerful.

This article wants to illustrate how you can use an ASC CDL color grade to modify an image’s exposure and white balance. The result will be an approximation only – but in fact, a pretty good one. We will try to illustrate why and how you can use that in your setup.

Use Cases for Digitally Adjusting Exposure and White Balance

Let’s first stick with the use cases for a bit and talk about why having controls for exposure and white balance at the DIT cart can be helpful in various ways. The camera (with its ASA, exposure time, and white balance settings) and the lens (with its aperture ring) offer the best places to get exposure and white balance right. But there are situations where exposure and white balance is chosen differently at the camera, or adjustments are simply easier and quicker done at the DIT cart:

  • There are situations where the scene requires to be a little under or overexposed – for instance, to avoid highlight clipping or noise in the blacks. Then the digital look on the preview monitors on set should compensate for that.
  • Light sources of different color temperatures are often mixed in a scene, and depending on where an actor is standing, varying lights are dominating. That can lead to a “cooler” appearance in one shot and a “warmer” appearance in another shot, although the light had not been changed. Again, it can be very helpful to compensate for that in order to achieve a consistent look on the preview monitors on set.

Exposure in Linear Lights Code Values

What is exposure, and what do we need to do to change it digitally? Adjusting the exposure means letting more or less light to the sensor. For example, when we open or close the aperture, we change the exposure – in a linear (!) way. Reducing the exposure by “one stop” (the typical set-term for exposure amount) reduces the light to only half of the light reaching the sensor. Increasing by one stop leads to double the light on the sensor, and increasing by two stops leads to four times the light (2×2) on the sensor. 

So we can provide a simple formula describing the exposure in linear light: It’s a multiplication of a fixed value (the exposure value) with every sensor value:

Exposure and White Balance with CDL and Log Signals

The example above illustrates this mathematical formula for exposure in linear light code values: We multiply by a factor. That kind of change of each code value is what we want to achieve when we use the ASC CDL to change exposure. Let’s take a look at what we can do.

The Log Signal

Vendors like ARRI, Canon, RED, Sony and others offer “log”-based output from their cameras. These signals always require certain processing to look decent on a monitor, such as a “log-to-video” LUT or an ACES color pipeline configuration. Also the grading color spaces/encodings coming with the ACES pipeline, such as ACEScct, are log-based.

Let’s take a closer look at what “log signal” actually means. For that, we imagine a (simplified) chain of processing blocks from the scene to the log signal on the SDI cable:

  • The sensor is the component that is hit by the light of the scene. It reacts in a “linear” way to the amount of light. That means that there is a mathematical relationship between the amount of light hitting a photo site and the electrical charge that’s created. This relation can be described as a linear function which means, for example, double the light leads to double the charge, 10% more light leads to 10% more charge etc.
  • The camera electronic converts that charge into digital values. If the camera records RAW, these linear values are directly stored in the RAW file (actually, more processing is usually applied such as calibration, de-noising, etc. but when concerning colors it’s more or less the linear code values). 
  • For the log output, an additional step involves converting these linear values into the log signal. This step is based on the mathematical “log” function, hence the name.

Exposure in Log Code Values (Spoiler Alert: With Offset)

The ASC CDL is typically applied on the “log” signal. So let’s find out how to use ASC CDL controls for exposure.

We saw that the log signal is based on the mathematical log function of the linear code values. Looking at that encoding, it is not apparent yet what to do to simulate what we saw above in linear light.

Exposure and White Balance with CDL and Log Signals

(Actually, the log curve is also moved up by 1 so that we can see it in the same range, but let’s ignore that as it’s not relevant for the argument).

Let’s de-log the log signal again (with an exponential function), and we’re getting back to a linear signal (left graph below). That’s not what’s sent to a monitor (there is typically some additional rendering and a gamma curve involved for that). It’s just for illustrating what we can do in the log signal and how that affects the (original) linear signal.

Exposure and White Balance with CDL and Log Signals

In the left example, that’s exactly what we do: Apply the log function to each code value, then an exponential function, and we end where we came from – in linear light and nothing changed.

On the right, we added a fixed value to the log signal. Take a closer look, and you’ll see that the “+0.1” is added to the log expression, and afterward the exponential function brings us back to linear light.

So what does that “adding a fixed value to the log signal” do to linear light? It does the same thing as multiplying the linear light code values with a fixed number (see the right example further above)!

What did we learn here? By adding a fixed value to every code value of a “log” image (a linear image treated with logarithmic function), we actually change the image’s exposure.

The last bit that’s missing is: How do you do that with ASC CDL controls?

The answer lies in the ASC CDL formula, which is 

Exposure and White Balance with CDL and Log Signals

(where s is the slope, o the offset, and p the power) for each color channel R, G, and B.

You already spotted our candidate: It’s the offset. The offset is added (or subtracted if negative) to each code value – and that’s what we need. When that CDL formula with that offset parameter is applied to the log signal, we have our “exposure control”.

Choosing the Offset Value

Unfortunately, we over-simplified things a bit here. The log function of the different “log” encodings is not a pure log function throughout the code value range (it often has a linear part towards the blacks), and it is parameterized quite differently from vendor to vendor.

So to make it useful for work on set, we recommend a small experiment. We assume you have a log output of the camera, some LUT processing in place, and Livegrade for controlling that with CDL controls.

  • Point the camera to a color card with some grey patches from black to white. Expose normally and take a frame grab. That’s our neutral image.
  • Then change the exposure of the camera, preferably by changing aperture physically on the lens. Expose one stop over. Take another frame grab. That’s our “physical” reference.
  • Now restore the normal exposure. Add the reference frame grab and the currently graded live signal to a split-screen setup. Turn the “Offset” knob in Livegrade as long as you have a good match to the reference frame grab. 

You will now see how good the theory from above works in reality. Some tools offer dedicated exposure controls (usually applied internally in linear light) that might match better. But if your workflow is based on ASC CDL, the method of simulating exposure with the offset of a CDL might do the trick; and for some use cases, such as preview or dailies creation, the approximation with CDL can be sufficient.

From the experiment above, you will get a value for offset (read from the grade UI) representing “one stop” for approximating the exposure change. Subtracting that value will reduce the exposure by one stop. Adding the value twice exposes two stops higher. You get the idea.

You can, for example, reserve a CDL node in the grading controls for exposure adjustments and store presets for different exposure changes using Livegrade’s node presets in the look library – but you know best how to manage that in your workflow.

White Balance

Let’s try to apply what we learned to white balance. We saw that exposure is a linear change of code values (applied to linear code values in all color channels). White balance is very similar. It is also a linear change of color values (applied to linear code values) but different for each of the color channels.

  • When the color temperature in the camera is turned warmer (lower Kelvin value), and thus the image looks cooler, mainly the blue channel values are increased linearly. 
  • When setting the color temperature cooler (and making the image look warmer), mainly the red channel values increase linearly. 

In fact, that’s again simplifying things quite a bit here as it’s not always exclusively the red and blue channels that need to change. Depending on the current white balance setting and the color properties of the sensor, there is a complex relationship between the Kelvin value of the white balance and the multiplication values for the different channels.

But in the end, with the right balance of multiplication in the color channels, we can get pretty close. And we learned above that we can use the offset control in ASC CDL for that. As the ASC CDL formula is applied to each color channel independently, the three offset values for R, G, and B can simulate a color balance change quite well.

Controls in Livegrade

We only talked about the “Offset” control of the CDL controls in Livegrade so far. But there are a few others that are worth mentioning in that context:

Printer Lights Controls:

“Printer lights” is the name of a set of controls used in film technology, where you balance the light of three differently colored lights shining through film during operation in the lab or at the Telecine. We saw above that balancing color channels can be used to perform white balance in an image. In Livegrade, we have dedicated, CDL-based printer lights controls (in the PRT tab of the CDL controls) that map directly and exclusively to the offset values of the CDL.

So basically, the exposure controls and white balance controls (to be more precise: an approximation of exposure controls and white balance controls) are available in Livegrade in the form of the printer lights controls. You only need to know that this only works if we’re working on log signals.

Warmer / Greener Controls:

Livegrade’s “Simplified Grade Controls” (the SPL tab in the CDL controls) offer “warmer” and “greener” controls. These are not intended to act as white balance but meant to give the image a warmer/cooler or greener/pinker look in a different way. These controls are designed to change the dark and mid tones, but leave very bright colors (white) untouched. So these controls totally miss the requirement for white balance, however, they provide a quick way of “tinting” the image while preserving the white point.

Summary

In this article, we illustrated the relationship between a CDL-based color grade of a log signal and the effect for linear light. We saw that the Offset values of ASC CDL can be used in practice to approximate exposure and white balance adjustments quite well. That shows how much is possible with just three of the ten parameters of CDL.

Edited 29. Mar 2021: Corrected history of printer lights, added reference to dedicated exposure controls, and added “approximation” where suitable.

About the Author
Patrick is head of products for Pomfort’s on-set applications. He combines a technical background in software engineering with practical experience in digital film productions – and a preference for things that actually work.