AcademySoftwareFoundation / AcademySoftwareFoundation/OpenColorIO

About an "InterpolatedMatrixTransform"

Open
#1,536 8 comments 1 reaction 0 assignees View on GitHub
Feature Request help wanted Needs Discussion
Dominant language
C++
Stars
2.1k
Forks
503
PR merge metrics
No merged PRs in 30d

Description

Hi,

Starting an issue here so that we can discuss about an hypothetical future `InterpolatedMatrixTransform`. It also makes me think that there is maybe a case for introducing OEP(s): OpenColorIO Enhancement Proposals ala Python PEP, e.g. https://www.python.org/dev/peps/pep-0586/.

Anyway, the rational and context behind the `InterpolatedMatrixTransform` is as follows: We sometimes end up in situations where it would be convenient to be able to dynamically produce a new matrix as a function of a scalar parameter. For example, *shameless plug and spoiler alert*, [we have shown at Siggraph 2021](https://jo.dreggn.org/home/2021_spectral_imaging.pdf) that the camera specific calibration for a LED Wall is white balance dependent and a quick way to appreciate that is the following plot:

![image](https://user-images.githubusercontent.com/99779/142154685-08b91e60-4919-46c0-a9cb-434f90f72399.png)

```
An IDT produced according to P-2013-001 is optimized for a given white-balancing colour
temperature. The resulting nx3 matrix defines the basis of an implicit RGB colourspace that
changes as a function of colour temperature. This can be observed in Figure 3.16, where the
implicit RGB colourspaces for Camera C are plotted for various colour temperatures.
```

One might understand how painful it is to handle all those transformations with OCIO and also that it is impossible to handle intermediate states.

With a reduced set of matrices, i.e. two, and a dynamic scalar parameter, it should be possible to express all those transforms with a single parameterized transform. @remia posited that it could be generalised and maybe have a way to blend any arbitrary transform. The scope for that might be bigger as we potentially need to render the two states and blend them together. With the suggested `InterpolatedMatrixTransform`, you really only need to generate a new matrix on the CPU thus it only requires rendering once.

Some other (related) use cases:

- Emulate what the DNG SDK does by interpolating for example D65 and Tungsten matrices as a function of white balance.
- Produce plausible albeit non-ideal intermediate IDTs.

Voila! Keen to hear people thoughts on this one.

Thomas

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.