Color Space Management: sRGB, Linear and Log

Article / 16 January 2018
When working on a live action feature we are typically provided with shots, which basically mean a sequence of raw images - also called “plates” - that were created as a product of digital filming. These shots are provided to us in a raw format, dependant on the filming camera, which can either be a logarithmic or linear space. This can quickly get confusing, especially when painting in Photoshop, so let’s have a look at what’s the difference between these color spaces and how to approach them from a painter’s perspective.


Linear versus sRGB
In a linear color-space, the relationship between the stored numbers and the values they represent is a linear 1:1 ratio. This means that, for example, if you double the number, you double the intensity. That sounds really easy, but the problem is that the human eye sensitivity to light is much finer at lower intensities than at high intensities. In particular, if we're using 8 bits to represent values (which means a total of 256 shades), we'll end up with too many light shades, and not enough dark shades (figure 1).




Thus, while a linear space makes perfect sense to use for computer processing, it is not suitable for human viewing because our eyes expect to see about the same amount of brightness change in between equal intervals. For example, our brain expects to see shade 32 twice as bright as 16, and shade 48 (which equals 32+16) twice as bright as 32.
To address this problem, most modern monitors apply a transformation called sRGB, a standard which uses a gamma curve to make the colors non-linear (figure 2). The curve is shallower at the bottom, so it can display more dark values, and steeper at the top, so it can have fewer light values.






So now that we’ve briefly seen what linear and sRGB stand for, we are facing the following issue: we want our images to be processed in a linear space - which is computer friendly, but stored in sRGB - which is human friendly; However, since we’ve already established that 8bit linear doesn’t have enough dark shades, this could cause problems when converting to and from linear. As such, the solution we found was to widen the range from 8 to 16/32 bits, thus having much more dark shades to work with. These kind of images are called HDR (high dynamic range) and are typically stored as 32bit OpenEXR (.exr).


So, problem solved? Sadly not for painters; If working in 32bit was an option, then we wouldn’t have had a need for this article. Alas, most Photoshop tools function properly only in 8 or 16bit modes and there are two problems we encounter when we try to view a 32bit linear image back inside a regular 8/16bit sRGB workspace:


  1. Without a way for the software to know how to display all that information, an unmanaged 32bit linear image will appear to have very high contrast, meaning very dark midtones and over-exposed highlights (figure 3). Part of this problem can be solved by applying an inverse gamma curve.
  2. Converting a 32bit HDR image into an 8bit LDR equivalent is a destructive process, because we’re losing all that extra information we tried to save in the first place. This is usually referred to as ‘value clipping’ so when a compositor tells you the painting doesn’t have enough range or that it’s ‘clipped’, it usually means it doesn’t have enough detail in the highlights and/or shadows. Note: This also happens when you start and create your painting in an 8 bit workspace and then pass it off to comp.

Figure 3. Left image represents an unmanaged linear 32bit image. Right image is the proper managed view.

So then how can we solve this problem as painters?
Since most Photoshop tools function properly only in 8 or 16bit modes, we need to find a way to paint in those modes while retaining all - or most of - the information available in a 32bit format. Here comes “Log” to save the day!


Log (short for logarithmic)
You can think of log as a color space “archiver” (in the same way zip or rar does it for files). This is because, while linear space increments values in equal steps, a logarithmic color space compresses the values in the white and black areas of an image, thus minimizing the space required to store the information (figure 4).




As a side effect, this format also allows us to paint in more manageable formats such as 16 bit .tif; This is because, if you follow the above analogy, a 16 bit log file can “unarchive” to a 32bit linear format without clipping.
The most common log formats that you will encounter are ARRI Log and Cineon Dpx.


Log Painting Workflow for Matte Painting

Whether you were provided with a log plate or you converted a linear one into the log equivalent, you will need to do some color management in order to be able to paint accurately.


Typically this involves several operations:


1. Displaying the log material with the target LUT
As “log” images represent a very large dynamic range, most midtone pixels reside in the middle portion of the coding space. Thus, if you directly display a ‘log’ image on a regular sRGB monitor it will appear to have low contrast and desaturated colors so some form of color management is required in order to preview the plates with the right color profile.


The way we do this in Photoshop is by applying a ‘Color Proof’ preview based on a LUT (Look Up Table) which tells the software how to tone map the colors and values of the Log image in order to make it look like the target profile. Please note that this display transform is never baked into the image and represents only a preview since we want to preserve the color space.


This option is found under View>Proof Setup.


Tip: Pressing CTRL+Y allows you to quickly toggle on and off the color proofing. Do this often in order to check for values, especially darks; Sometimes what looks right in the preview can actually be wrong in the Log space.


2. Converting reference images to the log color space
As matte painters, we often work with photo refs to create our environments. The problem is that, unless created by the same camera, these images are most likely in a different format, more commonly as 8bit sRGB. Since we intend to preserve the plate and deliver our paintings in the same space as it was provided to us, we need to convert the reference before we can use it. There are three ways of doing this and I will list them from the least prefered to the best one.
  • Adjustment layers: If you have a very keen eye, you can use a combination of adjustment layers such as Curves, Hue/Saturation and/or Color Balance in order to match the reference to the Log space. Please note that while doing so you need to toggle off your color proofing and look into the raw, low contrast view of the plate, making sure that all levels match.
  • Photoshop conversion: You can convert the refs directly in Photoshop by using a Color Lookup adjustment layer and loading a 3 dimensional look up table (3D LUT) file. This method is however reliant on being provided with an accurate lut file and is prone to errors, so make sure you double check everything after you convert.
  • Nuke conversion: If you have access to Nuke, you can bring the refs in there and easily output them in the right color space. This process can even get automated with the help of a script, and it’s also the most accurate!


3. Converting back to linear
As we’ve discussed before, all other CG workflows/pipelines - such as compositing, lighting, lookdev - are based on a linear space processing. We’re only using a log space to make it easier for us, but once we’re done with the painting we need to convert it back to 32bit linear so that the other departments can use it.
The easiest way to do this is by doing a conversion in Nuke, but each studio has it’s own conversion tools so please check with them first.


In conclusion
I hope this article helped to explain the differences between linear, sRGB and log spaces, as well as why do we prefer to paint in a log space and how to properly manage it! If you have any questions or you found a certain part of article to be unclear, please feel free to contact me!


5 Advices for Young Professionals (and not only)

General / 22 May 2023

As I’m getting close to my 20th anniversary in this industry I wanted to start writing a series of articles based on my experience, that will, hopefully, help the "next generation" (Now I'm starting to feel as old as Picard). This first very short article is about some “unwritten rules” that are hard to know when you first start in this industry, unless someone tells you about them. As a disclaimer, these are just my personal opinions, based on my personal experience.


1) Hard work is appreciated, but don’t assume everyone is aware of your efforts

One of the mistakes we often make is to assume that hard work is automatically noticed by all the leads/managers/supervisors involved with the project. Oftentimes they are very busy and only see the results, but are not always aware of all the effort that went into achieving that result. So if you know you worked hard, innovated a new technique or went above and beyond to deliver on time, then don’t be afraid to point it out to your managers at the end of the project!


2) Hard work is appreciated, but soft skills matter too!

Being a great artist is fantastic, but oftentimes your managers will also look at how you interact with other people, how much of a team player you are and how much you like to help and mentor your co-workers. 

Even if you are not seeking promotions, you should still be nice to your coworkers and try to help as much as you can. Positivity will make a better work environment for everyone!


3) Hard work is appreciated, but don’t neglect your health, life and family.

I know it is easier said than done, but trust me - no matter how young you are, your body still has limits. It may seem ok for you to push your limits now, but everything has a cost down the road. If you don’t feel well, take a day off. If you have to work long hours, make sure you set aside some time that you can spend with your family. If your company doesn’t understand you are a human being and not a robot, then it’s time to find another one!


4) It’s impossible to avoid office politics

Office politics are not something you can sit out, regardless of your level. Even though most people dislike them (including myself), the reality is they are a part of every organization. There will come a time when you will realize that focusing only on your performance is very unlikely to get you the success you’re aiming for - be it a bonus, promotion, or recognition from your managers. However, investing time in your networks and building the connections that can speak for you and your work will.


5) Don’t be afraid to ask for a raise

Every regular employee expects some sort of a raise from time to time. But especially if you worked hard and contributed a lot, don’t be afraid to ask for a yearly raise. Remember that any year you don’t get a raise, it’s a year your salary goes down! (due to inflation)

Over the Moon release date: October 23!

General / 29 September 2020

Final Over the Moon trailer is here! This is the project I've worked on for the past 2 years and it's gonna be released on Netflix, October 23rd!


Over the moon first trailer

General / 24 June 2020

Over the Moon, the project I've supervised matte painting & environments for 2 years, finally has it's first trailer out! It's great to see all the positive reactions! I think I'm speaking for the entire team when I say we are proud to have contributed to this awesome film! 



Q&A Session - 2020

General / 24 February 2020

Hello everyone! I'm opening up the first Q&A session of 2020 - if you or anyone you know might have questions about the film/animation industry, matte painting, environment concept art and anything in between, please feel free to message me or comment on this post. I will try my best to answer directly to every question and then I will compile a list with the most common ones!

Smallfoot - Wonderful life

News / 30 August 2018

Smallfoot gets released later in September, but WB just released a song sequence that contains some of the cool environments we worked on here! Ckeck it out below




 

Smallfoot trailer is out!

News / 25 April 2018

First Official Trailer for Smallfoot is out, the show I'm currently working on leading a super team of artists!



Canadian Rockies Reference Packs

General / 05 June 2017
Recently took a trip to the Canadian Rockies, where I found some of the most amazing and inspirational scenery - lots of fantastic lakes, glaciers, valleys and of course mountains. I've managed to take some very rare photos of remote locations that you can only access or see during certain times of year (such as Athabasca Glacier, Frozen Bow Lake, Lake Louise), and made them available in reference packs on my gumroad, check them out! https://gumroad.com/l/rockies-pack-1https://gumroad.com/l/rockies-pack-2https://gumroad.com/l/rockies-pack-3

Rocks and Exposed Seabed Reference Pack - Now Available

General / 18 April 2017
Hey everyone,
So I figured I had a ton of exposed rocks & seabed photos from our Vancouver shoreline and I put them together in a reference pack on gumroad: https://gumroad.com/l/QnquA
All royalty free, hopefully they can be useful to you too!