Converting Between Color Spaces Using Connection Spaces

It is often necessary to convert between color spaces several times along an image pipeline. For example, you may need to convert several inputs from different spaces to a common working space so that they can be composited and blended, and then convert to another space for output.

To minimize the number of different color transforms that are needed to convert from each color space to every other one, it is common to use one color space as an intermediate or connection space.

For example, to directly convert back and forth between 4 color spaces, you would need 12 different transformations. Adding a fifth color space would require 8 more, or 20 in total. In general, adding an Nth space requires an additional 2(N – 1) transforms, or N2 – N transforms in total.

However if you use a connection space, you only need 8 transformations to convert back and forth between 4 color spaces. Each additional color space requires only 2 additional transforms, or 2N transforms in total. But note that each conversion now requires two steps: the first to convert from the source space to the connection space, and the second to convert from the connection space to the target space.

Autodesk Color Management includes transforms that allow you to convert back and forth between color spaces using one of two connection spaces:
Note: The transforms in the primaries/ directory convert only the primaries. They expect and produce a linear color space encoding, and they can be applied to either scene-linear or output-linear values.