How can color software convert colors so fast?

How can color software convert colors so fast?

Apart from simple per-channel or 3 × 3 matrix conversions, it often does most of the work in advance. It calculates the conversion at selected colors and stores the results in a color lookup table, the CLUT. These samples are the table’s nodes. For colors between them, it estimates the result by interpolation.

A 33 × 33 × 33 RGB table, for example, stores 35,937 nodes instead of a separate result for every possible RGB value.

It is very convenient to adjust the indexing space with a set of curves to make the interpolation as linear as possible. An additional set of curves at the output may help in fine tuning gamut boundaries.

Much has been written about which CLUT interpolation method is best.

Some people argue that higher-order spline interpolation works better, but that does not mean it needs to run on every pixel. Fumoto et al. (NIP13, 1997) describe using splines to build a denser LUT, retaining fast linear interpolation during image conversion. Bell and Cowan (CIC 1994) also found that a piecewise-linear approximation could sometimes reduce the error of a spline model fitted to noisy data.

Trilinear interpolation uses the cell’s eight corners.

Tetrahedral interpolation, used for color correction in Sakamoto and Itooka’s 1981 patent, is one of the finest methods. The patent has long expired. It divides each table cell into tetrahedra and uses four vertices to calculate a result. Fewer vertices mean less data to fetch, but tetrahedral also has a useful geometric property. In the usual six-tetrahedron arrangement, all six share the cell’s main diagonal.

RGB and CMY work great with tetrahedral. CMYK would need hyper-tetrahedra (called pentachora), but it can be done by interpolating two CMY slices at adjacent K nodes, and CMY has a centered neutral axis.

On other indexing spaces, though, the situation changes.

In CIELAB, neutrals follow a* = b* = 0, parallel to the L* axis. The RGB diagonal advantage no longer applies. For Lab-indexed tables, I personally use trilinear interpolation. Weed and Cholewo discussed this difference in a CIC 2002 paper.

There are other sampling arrangements too. Xerox patented tetrahedral interpolation over a hexagonal lattice, formed by offsetting alternating sample rows. Here, “hexagonal” describes where the nodes sit; the interpolation is still tetrahedral.