(Page 2 of 2 pages for this article  <  1 2)

Tuesday, November 30, 2004

A Different Light: Gamma-Corrected Compositing

A simple introduction to gamma-corrected compositing.

Here’s another one of our favorite tests to show the differences between gamma-corrected and linear light compositing:

  • Take a still image (a face works well), illuminate it with a simple light (such as a point light in After Effects), and animate the light’s value from 100% to 1000% over a few seconds, causing the image to “blow out” to white over time. Render a reference movie of this.
  • Apply a Levels effect to the source footage, and set the gamma to 0.4545. This will cause the light to interact with the layer in linear, rather than gamma corrected, space.
  • Apply a second Levels effect to the final composite, this time with gamma set to 2.2.
  • Render this new treatment, and compare it to the reference render.

In this case, you should note differences in the way the image blows out over time: The width of the bands in the transition area from somewhat normal color to blown-out color are broader when performed in linear space, looking subjectively more subtle or pleasing. Darker details such as the eyes and shadows in the creases of the face should persist longer in linear space, making the face recognizable longer during the blow-out (see the figures below). You will also find that you need to crank up the light much brighter - perhaps to 5000%, instead of 1000% - to completely blow out the image.

Overexposing an image with normal computer gamma causes it to blow out more or less evenly (left); applying the same illumination with linear light gamma creates a more subtle, pleasing effect (right). Original image courtesy Digital Vision.

These tests provide you a with blueprint of how to perform linear light compositing: Correct the sources to linear by applying a gamma of 0.4545, perform your treatments, and correct the result back to a 2.2 gamma. However, you cannot blindly apply this to any project. For one, some blending modes (such as Overlay, Soft Light, Hard Light, and to a degree Screen) will no longer work “properly” as they are based around the idea that a 50% pixel luminance value means 50% perceived brightness. You will also find that you will need to adjust or increase parameters such as light level, cone feather, and glow amount to achieve the same general results as you saw in the computer’s default space.

Nonlinear Thinking

This is all well and good if your goal is to mimic nature and reality...but that’s often not the goal of a motion graphics designer. For example, what if you want to favor the dark areas of an image instead of the light areas? Or what if you want a less (or more) severe effect? The simple answer is to experiment with gamma corrections other than 2.2. Here is one way to set up such a project with maximum flexibility in After Effects:

  • Add an Adjustment Layer to the top of your composition, and name it Master Gamma. Apply Levels (Individual Controls). Expose its RGB Gamma parameter in the Timeline window.
  • Apply Levels (Individual Controls) to your source footage layers. Reveal the RGB Gamma parameter, and enable expressions for this parameter. Type “1 / “ (without the quotes), and then use the pick whip to select the RGB Gamma parameter for the Master Gamma layer. Hit Enter to seal off the expression, which should now read:

    1 / thisComp.layer("Master Gamma").effect("Levels (Individual Controls)")("Gamma")

  • After you’ve gone through the trouble of creating this once, make an Animation Preset of it (use the Animation Preset popup in its Effect Controls window) which you can then easily apply to other footage layers.

Then perform any treatments, effects, or compositing you like! For starters, try the simple crossfade you created in the first example. In this example, place the time marker in the middle of the transition, and then vary the RGB Gamma parameter for the Master Gamma layer. Note how the composite image changes, favoring light or dark areas depending if the gamma is above or below 1.0 (see below).

A normal computer crossfade (left), a “linear light” crossfade (center), and a creative fade using the opposite gamma as linear light (right).

Hopefully this will open up your mind to the potential in gamma-corrected compositing. It’s not something you need to employ on every job, but it’s an important tool to be familiar with, for both realistic and creative applications.

Postscript

As mentioned earlier, After Effects 7 and later now implement linear gamma as option in File > Project Settings, which eliminates the need for all of these extra layers, effects and expressions. The one downside is that you can’t set the gamma correction yourself (the last trick shown above); it is currently hardwired to the perceptually-correct 2.2 value.

In After Effects CS3, there are two choices:

  • Linearize Working Space: When enabled, all image processing - including color profile conversions, masks, effects, 3D lighting, and the way layers are blended together - are performed in a gamma 1.0 space. The result is particularly strong with 3D lighting, as illustrated below:

It can be deceptive to set up 3D lighting in a scene (left) and then enable Linearize Working Space: The result will appear blown out (right) as the lighting will appear to be boosted.
  • Blend Colors Using 1.0 Gamma: This option can be thought of as “Linearize Working Space Lite.” When enabled, only the blending together of layers is performed in a gamma 1.0 space. You can enable this even when color management is disabled. It is enabled by default when Linearize Working Space is enabled.

In After Effects 7, there is only one choice: Linear Blending. It has the same effect as the Blend Colors Using 1.0 Gamma description above. We were greatly disappointed that we couldn’t achieve the lighting effect demonstrated earlier using this option in 7, but we now can using Linear Working Space in CS3.

Change these setting before you get too far into a project, as they will change how your composites look (observe the images above); you don’t want to select one of these modes just before blindly starting an overnight render!

By the way, Color Management in After Effects CS3 is covered in more detail in Creating Motion Graphics 4th Edition, Chapter 25.

Motion GraphicsPost ProductionVisual Effects

(Page 2 of 2 pages for this article  <  1 2)



My First Shoot with the Sony F35

Art Adams | 11/16- 06:41 PM

Lighting Simply for the RED

Art Adams | 11/13- 01:23 PM

Making “One Man, One Vote”

Adam Wilt | 11/03- 06:19 PM

The RED Camera and Green Screen

Art Adams | 11/03- 06:08 PM



Good point, and certainly a common point of confusion. Those not familiar with the details of how light really works are used to calling the way the computer works “linear”; indeed, in After Effects the Cineon conversion tools talk about converting Cineon to a “linear” (normal computer) space. But just as it took us awhile to learn that not all pixels are square, we’ll eventually learn that most computers show a gamma-corrected space, not a linear space.

Posted by Chris Meyer  on  02/15  at  08:15 AM


Name:

Email:

Location:

URL:

Smileys

Remember my personal information

Notify me of follow-up comments?

Submit the word you see below:




Advertisements
















Copyright 2008 ProVideo Coalition LLC