Needables
  • Canon EOS 7D 18 MP CMOS Digital SLR Camera with 3-inch LCD (Body Only)
    Canon EOS 7D 18 MP CMOS Digital SLR Camera with 3-inch LCD (Body Only)
    Canon
  • Canon EOS Rebel T2i 18 MP CMOS APS-C Digital SLR Camera with 3.0-Inch LCD (Body Only)
    Canon EOS Rebel T2i 18 MP CMOS APS-C Digital SLR Camera with 3.0-Inch LCD (Body Only)
    Canon
  • Redrock Micro Captain Stubling DSLR Bundle, with Baseplate & Lens Gear Size A 32 Pitch, Black
    Redrock Micro Captain Stubling DSLR Bundle, with Baseplate & Lens Gear Size A 32 Pitch, Black
    Redrock Micro
  • Canon EOS 5D Mark II 21.1MP Full Frame CMOS Digital SLR Camera (Body Only)
    Canon EOS 5D Mark II 21.1MP Full Frame CMOS Digital SLR Camera (Body Only)
    Canon
  • Canon EOS 1D Mark IV 16.1 MP CMOS Digital SLR Camera with 3-Inch LCD and 1080p HD Video (Body Only)
    Canon EOS 1D Mark IV 16.1 MP CMOS Digital SLR Camera with 3-Inch LCD and 1080p HD Video (Body Only)
    Canon
  • The DV Rebel's Guide: An All-Digital Approach to Making Killer Action Movies on the Cheap (Peachpit)
    The DV Rebel's Guide: An All-Digital Approach to Making Killer Action Movies on the Cheap (Peachpit)
    by Stu Maschwitz
  • Panasonic DMC-LX3S 10.1MP Digital Camera with 2.5x Wide Angle MEGA Optical Image Stabilized Zoom (Silver)
    Panasonic DMC-LX3S 10.1MP Digital Camera with 2.5x Wide Angle MEGA Optical Image Stabilized Zoom (Silver)
    Panasonic
  • Zoom H4n Handy Portable Digital Recorder
    Zoom H4n Handy Portable Digital Recorder
    Zoom
  • Adobe After Effects CS4 Visual Effects and Compositing Studio Techniques
    Adobe After Effects CS4 Visual Effects and Compositing Studio Techniques
    by Mark Christiansen
clicking makes us strong
Wednesday
26Jan2005

Color correction in linear vs. gamma corrected space

A brief example of how simple color corrections behave differently in linear floating point space than in display-corrected space.


image 1

A big reason we color correct with gamma when working in clipped color spaces is that we want to avoid flattening out white parts of the image. This is a valid concern.


image 2

This image is color corrected by multiplying the channels against constant RGB values. This is probably the simplest way to color correct an image, and here the results are quite poor. Subtly poor in how the tonal range is made inconsistent across light and shadow, but profoundly poor in the flattening out of the highlights.


image 3

This image shows roughly the same color correction, but using gamma. Because gamma correction does not affect white, the correction looks much more pleasing. There is also a pronounced contrast change in the image, which some may also consider pleasing, but some may wonder how they could avoid.

Images 2 and 3 were CC'ed in video space, or the raw, uncorrected pixels that we both store and display.

The next two images are CC'ed in eLin. They have been converted to a linear color space and the detail in the blown out window has been preserved.


image 4

Here is a similar gamma correction to the one used in image 3. As in image 3, white remains untouched. But two problems have arisen. Firstly, the linear color space reacts even more abruptly in the contrast and tonal range than the video space image did. The shadows get blocked up and the saturation and contrast changes quite a bit with our adjustment.

but more insidiously, note the darkening layer that I have placed over the window. As with image 3, white remains untouched by the gamma adjustments, But above white we have done a very surprising thing — we have inverted our desired tint.



In this graph of the gamma, or power, function, it's easy to see why. As the gamma curve bends the midtones up and down, it remains pinned at white and pivots there, causing the values above white to go in the opposite direction. So as we gammaed down blue and green, we were pushing values in those channels above 1.0 through the roof!

The scary thing here is that you might not see it at first, and you would go on about your business until you layered something over your windows, or darkened them with some other operation.


image 5

Here we are back to our simple multiplying of the RGB channels, but now we are in linear space with overbrights. Note that we have tinted the image warm without blocking up the shadows, changing the saturation, or altering the contrast of the image. Note as well that the overbright areas react in a very lovely way to the CC.

It's true that when you compare 5 to 3, you may find that some of the “downsides” of the gamma correction in vid space are visually pleasing. The enhanced contrast and variation across the tonal range look a bit sexier than the clean and flat tinting in linear space. But it's important to be able to color correct at a very simple level without getting all this extra artifacting, and this is very challenging in vid space. But in linear floating point, it's no problem at all to add contrast in after a CC.

The other caveat is that we started with an image that had overbrights (an EXR file). Had we not had this extra information in the windows, image 5 would have the same clipped look as image 2.

It's not that you can't ever use gamma correction in linear floating point — you just have to be careful. I've found that in linear space, gamma should be the last thing you adjust, not the first, and this is very different than most peoples' current experience in clipped vid space.

Comparotron2000™:




Multiply in g2.2 clipped
Gamma in g2.2 clipped
Gamma in eLin/LFP
Multiply in eLin/LFP

Reader Comments (3)

You may never see this, but here goes...I'm probably missing the point because I'm just learning this. I liked the clarity of the window inside the circle of either img 4 or 5. Am I correct in guessing you would bring that out, in a later step, after your linear/gamma corrections?

February 24, 2007 | Unregistered CommenterFlic Maker Scott

I'm not sure I fully understand your question Scott, but the circle showing what's outside the window is simply showing what's happening in the overbrights. If you wanted to bring that into visibility over the whole window, you'd either have to mask out the window and expose it down, or explore some tone-mapping methods.

February 25, 2007 | Unregistered CommenterStu

That was it! Thanks, Stu.

February 25, 2007 | Unregistered CommenterFlic Maker Scott

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>
« learn you up some eLin | Main | eLin in Videography »