The VFX Color Pipeline

Michael McCartney
7 min readJul 25, 2019

Color is, well, hard. Even when you know everything about color, you know nothing about color. Aside from a few masters of the subject, even those with years of VFX experience can find the color world and all it’s intricacies a bit daunting.

The only way I learned any real concrete understanding of it was by coding a VFX flip book review application that included a color pipeline. I know most people don’t have time for that so I thought I would boil down what knowledge I have for those in a hurry as well as, for interested parties, a deeper dive into the wild world of digital color.

The Basics

Obviously, we can’t really start without the most general question…

What is a Colorspace?

Photo by Sven Scheuermeier on Unsplash

(Warning, fancy description inbound)

A color space is a specific organization of colors. In combination with physical device profiling, it allows for reproducible representations of color, in both analog and digital representations. — Wikipedia

My definition: “Based on the way that image data is stored, the colorspace tells applications how to interpret the information and display/manipulate it properly.”

We’ll get into why they exist and we don’t just use the same colorspace all the time soon. For now, it’s safe to assume most image formats have a “default” colorspace. A proper jpeg, for example, will almost always be stored in the colorspace sRGB. OpenEXRs, on the other hand, lean towards always being in Linear.

tl;dr

For those who are hear to learn just a foundation of the color pipeline rather than the intricate math and definitions, let’s go through the absolute basics and an example “Utopian” color workflow.

The “L.M.L.D” flow. A basic description of what happens when we work on an image in modern “Linear Color Applications.” Note: The darkening of an image during the Linearize step is expected and not for dramatic effect.

At it’s most brief this common workflow does:

  1. Convert input image(s) to a common colorspace, typically Linear.
  2. Do our modifications on these images in the same colorspace. This makes it easy to do image manipulation.
  3. Then, optionally, apply a Look, or series thereof. A Look typically takes the form of a LUT. IMPORTANT: A Look does not change the colorspace!
  4. Finally, at the last second, we convert from that common colorspace where we did our manipulation to account for the way your display shows color. Most displays use the colorspace sRGB or something close to it. When writing images to disk, we may bake this information in (a-la jpeg) or leave it in the linearized space (a-la OpenEXR)

That’s it(ish)! If you can grasp that, you now have an above average understanding of color when it comes to the VFX world. There is no “one color workflow to rule them all” but rather dozens of ways to communicate through colorspaces. All of these ways, however, follow some form of this paradigm. Manipulation on all imagery is done in a single colorspace and converted back and forth where required.

Before You Go

Before you venture off with your new found color mastery, I recommend getting into the next couple sections to harden your understanding of color theory and the VFX color world. The next section get’s into some of the finer details without too much math and history.

The Not So Basics

For those who have decided to stick with me on this color trip, I salute you. Let’s start with some questions that you might ask “Why didn’t we cover this in the basics section?”

What is Linear Color?

Photo that has nothing to do with linear color but the math looks really cool. Under the hood some math is done but, unless you’re making the software, it’s not all that vital to know.

Linear color is crucial when talking VFX. Thankfully it’s also the most straight forward. This is the “I am right!” colorspace. This simply means that a color value of 0 is black, 1 is white, and 0.5 is 50% grey. That’s vital because we do math “linearly” on a daily basis (e.g. 0.25 * 2 = 0.5). It’s the same math you’ve been taught since those fateful days in elementary school.

Images are saved in any number of colorspaces that a “Linear Color Application”, a term I’ve made up, can interpret and convert from said colorspaces to linear. Nuke, for example, is an LCA.

What is sRGB?

This is where the history begins!

Eugh… What a nerdy image. This is a color profile that dates back to the 1930’s with the sRGB colorspace (1996) placed in it. It’s important to notice how much information sRGB is missing and why the VFX industry does what it can to stay away from it. This photo is a great view into that loss of data.

Colorspace and much of color theory as we know it today find it’s roots in TV when it was first coming into the world. At that point we only had so much information that could be shipped from the tubes and sensors. We couldn’t waste any bandwidth.

Humans, the clever devils that they are, developed a standard to go from light entering the camera, which is linear, to image information that could be displayed by your average television with a half decent range of values.

Fast forward to slightly more modern times. Circa 1996. Mariah Carey was killing the billboard charts, grunge was still in for no good reason, and it was then that HP and Microsoft sat down and developed sRGB to standardize the way our average monitors displayed color.

While this colorspace is extremely outdated, it’s still widely used and will most likely stick around for a long time. In the sRGB colorspace 0 is still black, and 1 is still white, but to get to %50 grey, you have to use a value of ~0.73536 and 0.5 is 18% grey. Which, I know, sounds strange, but let’s look at a little math with pictures to describe what happens.

Note: There are dozens of other colorspaces that you’ll see out there but the concept is the same as sRGB.

What Does it Mean?!

At this point, we can put a some elements together to see why linearization is vital.

Remember that linear equation above?

color_a = 0.25 # linear value
color_b = 0.25 # linear value
color_a + color_b = 0.5 # linear value

Simple! Now, let’s say we did the same math in different colorspaces. := is what well use for assigning sRGB color.

color_a = 0.25 # linear value
color_b := 0.25 # sRGB value
color_a + color_b = 0.3008760881715568 # linear value

Huh?? How TF can 0.25 only equal 0.05?! Well, color_b has to be transformed into a linear value in order to add them together.

sRGB at 0.25 is ~0.05 when converted to linear. It’s a bit funky but getting used to this concept will go a long way in helping understand color theory. Note: The sRGB block is darker than the linear block, it’s almost black.

To convert to linear, we do the approximately the following (Note: you don’t have to know this. That’s what the LCAs are for):

convert_srgb_to_linear(srgb):
if srgb <= 0.0404482362771082: # ?
return srgb / 12.92 # ?!
else:
return pow(((srgb + 0.055) / 1.055), 2.4) # ?!?!

That’s crazy right? That’s the “linearization” process for just sRGB. Each colorspace comes with it’s own equation to linearize and then transform it back to the original. This process is vital because otherwise, you’re doing the math on values that are not equal!

You Probably Skipped That Part

It’s complicated and boring. I get it. But, understanding that, even at a basic level, will unlock a whole new way to think about not only color but how we can manipulate it to do our bidding.

Once We’re Linear.

It’s VFX time!

Now that we’ve converted values to linear via their input colorspace, we can go crazy with any operations required. Comp our scene together, fire up the retime, get that building on fire, blow up that bridge! All of this within a linear color world.

Photo by Jacob Miller on Unsplash

That’s the best part — the math, while complicated, is rational and we get expected results because we’re not using values scrunched in some limiting colorspace.

There are colorspaces out there that account for the whole color spectrum (Check out ACES) but they are relatively uncommon as of this writing.

Showing The User

Skipping the Look section, let’s get right to the monitor. For more information on the Look, check out this article.

When we want to present the image on our device (e.g. monitor, projector, print media, etc.), we have to make sure that the colorspace that display uses is what our image data takes on, otherwise we’ll have widely inaccurate color. That’s where the Display part of our info graphic comes in. Just like the linearization step, we now just convert linear to the display colorspace.

We Made It!

That, with about a thousand caveats, is the color pipeline for VFX. If you’ve ready everything here, I recommend reading it again in a few days to let it sink in a bit more. When first learning this, it’s often something that clicks on the third or forth time going through it.

--

--