RedShark News - Video technology news and analysis

Colour Look Up Tables demystified

Written by Phil Rhodes | Dec 26, 2017 12:00:00 AM
Colour Look Up Tables

RedShark Replay: One of the earliest articles we published on RedShark, but still mostly relevant today. As digital video cameras get better, and their users become more ambitious, LUTs are used to preserve or manipulate the images. Understanding LUTs is now key to setting up a production workflow

Anyone involved in anything other than the most basic camerawork or postproduction at the moment will quickly encounter the concept of a lookup table, or LUT. They’re a simple enough concept, but there are at least two main types with significantly different capabilities, and they’re used for both technical and creative purposes.

The purpose of a lookup table is to make precise and repeatable changes to an image’s luminance and colorimetry, and as the name suggests, the most basic type of lookup table comprises a simple list of numbers. A ten-bit lookup table comprises 1024 numbers for each RGB channel, each representing the output value for a given input value. If the 512th value of the red LUT happened to be 501, every red value of 512 that went in would come out as 501. That’s a one-dimensional lookup table, and while it can make changes to overall luminance and colour balance by altering the values in each individual RGB channel, it cannot, for instance, make a purely red object into a blue one, or affect overall saturation or hue.

A billion possible values

To do that, we need a three-dimensional lookup table, so called because every possible combination of three RGB input values is associated with a unique set of RGB output values – or at least, in theory. Since there are over a billion possible discrete colour values in a ten-bit RGB signal, usually a somewhat smaller set of output values is stored and the results for a particular input value are calculated from an average of the most nearby stored output values. Because it deals with sets of three numbers, a 3D LUT can be depicted as a cube, and some systems call this sort of LUT a cube. If a LUT allows hue modification – that is, changing one colour into another – it must be a 3D LUT.

Creative reasons for doing any of this are found in many video cameras, particularly those which allow the user to make changes to saturation and individual colours. Options called things like “matrix”, which were once upon a time implemented as analogue processing amplifiers, are now more likely to be done in a single step using digital signal processing based on a LUT. Outside the guts of a camera, it’s common to apply a LUT to monitoring on set to modify the output of a digital cinematography camera to approximate the intended final grade, while the recording of the scene is made without the LUT for later adjustment. Monitors from vendors like Cinetal may include the ability to load LUTs, perhaps from a flash card, while Blackmagic have their HDlink range, which can convert an SDI camera feed into a DVI signal suitable for an off-the-shelf monitor while applying a LUT (uploadable via USB) in the process. In these cases, the making of the LUT is a creative process, involving subjective viewing of the image by a colorist and adjustment of the values using a grading application.


Log C and S-Log

Technical applications for LUTs are extremely varied, but commonly involve either conversion of one viewable image to another, or the conversion of data which was never intended to be viewable into a state where it can meaningfully be displayed. Non-viewable data? Well, yes; many even medium-grade digital cameras now support luminance encoding options which are extremely low in contrast and effectively unviewable without correction. These luminance encoding options, with Arri’s Log C and Sony’s S-Log perhaps most prominent among them, generally try to anticipate the grading process by using an equal number of luminance values to encode each stop of luminance range, closely approximating a logarithmic encoding of the original data. This can minimise the tendency of digital signals to fall apart into banding and quantisation later on, but the resulting image is extremely flat and foggy and must be corrected by applying a LUT before it can be meaningfully viewed. LUTs for these applications may be mathematically generated to ensure the output image is to a certain standard, although LUTs used for viewing log images on set may include both technical correction of the flat, maximum-range image, and a creative grade.

Don't bake-in a LUT

It’s important to ensure that LUTs are not applied at the wrong stage of the process. Inadvertently applying a viewing LUT to a log image then recording the result – that is, baking in the LUT – will destroy the information-rich log image and make grading difficult or impossible. Likewise, applying the wrong LUT to an image can lead to mistaken lighting and camera setup decisions and sub-optimal performance, particularly exacerbating noise. Failing to use a LUT when one is required can also cause problems, such as any situation where log images must be graded to suit a Rec. 709 or sRGB display; failure to use a suitable LUT will cause manually-applied gamma changes to greatly exacerbate shadow noise.

Most camera manufacturers provide LUTs for various purposes depending on the camera settings and the characteristics of associated equipment, and it’s worth being very careful here as exactly what constitutes “log output” from a particular camera is really defined by nothing more than the manufacturer’s opinion as to what works best. This can, as anyone who’s tried to create a complex postproduction path will know, become complicated. LUTs are supplied in various formats to various pieces of software and hardware. Some software lacks the ability to load LUTs at all, and users will require an external  hardware device. Unknown display calibration and the world of difference between Rec. 709 devices such as TFT monitors and the XYZ world of digital cinema are a significant confounding factor.

LUTs will be around for the foreseeable future

In some ways, the proliferation of potentially very powerful colorimetry tools into fairly low levels of the film industry is a danger. When you take what would historically be a camera’s colour processing features out of the hands of design engineers and give it to rushed, overworked end users on a film set, mistakes are inevitable. Perhaps in the end we’ll all be recording enormously high precision data which can be entirely manipulated in post (which was the Thompson Viper concept), but even then, we’ll need some way of creating an appropriate-looking image for the monitors and LUTs will therefore be juggled on film sets for the forseeable future.