AcademySoftwareFoundation / AcademySoftwareFoundation/OpenColorIO
About an "InterpolatedMatrixTransform"
- 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:

```
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
Assessment
This issue has not been assessed yet.