Film: Deep Color
Issue: Volume: 26 Issue: 5 (May 2003)

Film: Deep Color

Barbara Robertson is a contributing editor of Computer Graphics World and a freelance journalist specializing in computer graphics, visual effects, and animation. She can be reached at:

In late January, Industrial Light & Magic (San Rafael, California) released source code for its proprietary, extended dynamic range image-file format into the open source community. Dubbed OpenEXR, the format provides a possible standard for 16-bit floating-point color images.

16-bit floating point gives people who manipulate color and contrast in scanned images much more elbowroom than the commonly used 8-bit and 10-bit formats. In addition, if widely adopted, it would help studios exchange high dynamic range image files.

Created for internal use in 2000, tested on such films as The Time Machine (see CGW, March 2002, pg. 24), Men in Black II, and Gangs of New York, and currently utilized for The Hulk and other films, OpenEXR was devised by ILM software engineers Florian Kainz and Rod Bogart.

Although the source code has been available for only a few weeks, support for the standard is growing among computer graphics hardware and software vendors. It's too early to say for sure, but it looks like the effort put forth at ILM to turn its proprietary code into a format suitable for public consumption will pay off.

"The advantage from our side is that you can color correct an image and remove those corrections later without image degradation," says Tom Benoit, founder of Interactive Effects, which is supporting OpenEXR in its Amazon Paint and Piranha visual effects products.

To demonstrate this, developer Kainz points to his computer screen, which shows a scanned photograph of an office that was saved as a JPEG image, an 8-bit file format. "When I make the image half as bright, which is something we might want to do in post processing, the window should still be white, but it's murky gray," he says. What's more, the window is the same shade of gray as a piece of white paper in the photo even though, in reality, the window should be several times brighter.

"The white was limited to being as bright as the screen could display because with the 8-bit formats, you have only 256 values per [RGB, for example] channel," Kainz explains. "But with 16 bits, you get 65,000 values per channel." That means you could have trillions of colors. But why? "The point of having so many values per channel is that within a wide range of brightness levels, any conceivable color can be represented very accurately," Kainz says.

With the same picture onscreen but saved in the OpenEXR format, Kainz once again begins adjusting the brightness. "Because of the floating point, we have a very wide dynamic range so we can go darker and darker and darker until we can actually see something outside the window," he says. Indeed, as the interior gets darker, the window changes from blown-out white to reveal an office building in the landscape outside. "That was 100 times darker, we can go even darker," he says. As he pushes the slider, the sky turns blue, and then power lines appear in the background. "That was 300 times darker than the original. Now we can go back to the original brightness and crank it the other way." At 30 times brighter than normal, I see stuff under the couch. "That should have been cleaned up," he laughs.

Kainz created the office image by combining multiple exposures to make the point: OpenEXR can handle all the dynamic range film can offer. It provides the equivalent of 30 f-stops without loss of precision plus 10 more at the low end with minimal loss of precision. This range gives compositors and those doing color timing far more latitude than before. "With something like JPEG, you have maybe 20 steps between f-stops so if you do severe color distortion, banding becomes apparent," Kainz explains. "But with OpenEXR there are 1024 steps per f-stop so you can distort the colors quite a bit without seeing banding."

Other points about OpenEXR:

  • It allows an arbitrary number of channels of different types. For example: "You might want an RGBAZ image where the color channels (R, G, B, and Alpha) are 16-bit floating point and the depth channel (Z) is 32-bit floating point," says ILM's Drew Hess, who is shepherding the file format into the open source community. The Z depth would help, for example, add motion blur during compositing. "You can render the image without motion blur, but store the speed of each pixel, basically, along with the color," explains Kainz, "After you've done the composite, you can add motion blur as the last step."
  • A lossless compression scheme based on wavelets reduces the size of OpenEXR files by two or three times. "We have verified that we can compress, uncompress, and recompress an image any number of times, and the bits end up being exactly the same," says Kainz. "You can zoom into the compressed image and not see any blocking effects or sprinkles."
  • To display 16-bit images on 8-bit monitors, the 65,000 values per channel are mapped into 256 values per channel. As Kainz demonstrated earlier: "You can see all the colors in the image," says Hess, "but not at the same time." This could mean a slight lag as the conversion is calculated...unless you're using an Nvidia card, NV30 or above. On these cards, the calculation happens in the GPU, and it's fast. Support from other board vendors is likely to follow.

Nvidia got an early start through a bit of serendipity. As ILM was developing the format, it disclosed its plans to Exluna, a Berkeley-based rendering software company that was in the process of being acquired by nVidia and knew nVidia was working on 16-bit floating point as well. "We became the post office box on the corner where both companies could put their secret data and make sure it was compatible," says Beth Loughney, formerly with Exluna and now senior director, studio relations at nVidia. "IEEE has 8-bit and 32-bit standards, and also 64-bit, but no 16-bit. There are a couple ways to cut 32 bits in half, and both companies had made basically the same choices." ILM made a few changes in its format and the two matched.

In addition to the OpenEXR libraries, available under a modified BSD license on the Web site, ILM created a viewing program called EXRDisplay, a display driver that allows RenderMan to write out OpenEXR images, and it is readying a Photoshop plug-in for reading and writing images.

"The company has been good about supporting this effort," says Hess. "One of the reasons we've open-sourced it, though, is that we're hoping to get others contributing. We've already gotten a lot of support from the community." For example, ILM doesn't use Windows, so they didn't compile the code for Windows. "A few days after the release, some people grabbed the source code, ported it to Windows, and it worked," Hess says.

That may have been eyeon Software, which has already announced an OpenEXR plug-in for its Windows-based Digital Fusion 4 compositing software.

The OpenEXR image top is made 128 times darker (seven f-stops) at middle to reveal details outside the window. The original image is then made 32 times brighter (five f-stops) at bottom to uncover details hidden in the shadows.

Similarly, NXN reacted quickly. "About two weeks after the announcement two of our major customers alerted us to the format," says Gregor vom Scheidt, president. "The general consensus is that it's the improvement people have been looking for."

The next generation of NXN's alienbrain, an asset management tool used at Sony Pictures Imageworks and Pixar Animation Studios, will offer native support for viewing and annotating OpenEXR image files. Several other companies, while privately acknowledging their support, were unwilling to commit publicly until they had products ready to ship. But in the open source community CinePaint already supports OpenEXR.

"We're a fairly new entrant into the visual effects market, and we've noticed that there are not a lot of standards and there could be many more," says NXN's vom Scheidt. "ILM is a huge effects house that can afford to do proprietary things, so it's great they're supporting this standard. When the strongest player who least needs to do this moves in that direction, it's a great thing. The benefits will be reaped by smaller studios."

I couldn't have said it better myself.