This Matchbox shader performs a linear - or perceptually linear - colour-grade, defined by up to three colour-vector mappings.
Each vector mapping is defined by a source-colour and exactly one of three possible methods for assigning a target-colour, as determined by the individual Vector Modes:
maps the source colour to the specified target colour,
determines the target colour through an additive offset to the source colour, and
multiplies the source colour by a given triplet as the target colour.
Alternatively, if fewer than three vectors are required, each vector can be disabled individually.
In such cases, the orthogonal complement to the basis spanned by the active source colour vectors is mapped to itself. Note that in general, this orthogonal complement depends on the working colour-space, thus even if source and target colours for the active vector mappings are identical (in true colour, not value-triplets), the results may still differ.
However, if all three vector mappings are active and the source and target colours are kept consistent, the transformation yields the same result for any scene-linear working colour-space.
Each vector can optionally be normalised in luminance (active by default), which is calculated with the luma coefficients given by and (assuming ACEScg by default). This can be useful for shifting chromatics iso-luminance with the provided - and -modes.
When enabling , the shader operates according to the Oklab colour appearance model; most notably using the nonlinear response, and Euclidean perceptual colour-distances.
For correct transformations to this model, the working colour-space (of Front as well as Result) has to be set via .
By default, the target vector controls remain in working-space colourimetry, and results should be similar for small, well-conditioned adjustments. However, the Shift- and Gain controls can also be switched to Oklab Lab representation by activating . While works mostly analogous to RGB-colour-shifts, in Lab behaves noticeably differently for chromatic changes.
Colour selectors (for vector sources and targets) always are relative to the working colour-space.
Note that in perceptual processing, luminance normalization for vectors does not rely on the and coefficients but uses the Oklab lightness, and thus may produce slightly different results.
Finally, the image saturation can be adjusted via - applied after the vector-based grade.
For native processing, the luma coefficients and are used to calculate saturation; while for perceptual mode, the adjustment is applied in nonlinear ab chromatics.
Internally, a single colour matrix is computed, comprising the entire grade. For ill-conditioned source-bases - that is: similar source colours - this matrix might also get ill-conditioned, leading to extreme colour-shifts for image colours further to source-vectors. Even for only slight adjustments in target colours.
Further, linearly-dependent source-colours lead to undefined results.
Conversely, if the source colours are spaced sensibly far apart, the entire transformation is well-conditioned.
For enhanced accuracy, this matrix and the intermediate values are always processed in double precision arithmetic; yet since instead of computing the matrix for each pixel, an interposed data sampler is used, the computational overhead is constant and insignificant.
If even higher accuracy is needed, can be enabled, at the cost of performance.
This causes the application of the colour matrix on a pixel-basis (as well as the perceptual transformations) to be processed in double precision.
While for real-world images and use cases, the rounding error is negligible for standard processing; full double-precision can be useful if correctly-rounded Float32 results are paramount.
Note that this shader does not perform any image scaling or reformatting, so the operation may be incorrect if the result and input image formats don't match.
It is recommended to leave the canvas resolution as <Same As Input 1>.
This shader is licensed under the terms of the MIT license.
For questions contact:
nobbl211 _at_ gmail.com
Version notes
Added support for linear ARRI Wide Gamut 4 and REDWideGamutRGB working colour spaces
This shader is obviously incomplete (missing files, not loading) etc.
This shader violates IP rules (is pirated) or contains harmful content
You are having problems with the shader installer (INSTALL.command) or the download.
How to get help with this particular shader
Sadly, the custodians likely will not be able to explain to you how a shader works or debug its code, or fix it for you. That is the (volountary) role of the shader author.
If the shader does not work on your system or you have questions about it - read the shader description, and try to find the email address of the shader author.
Contact them for any issues – letting them know whether you are on Mac or Linux, what version of IFFS you are running etc. will likely help.
Be kind and respectful. If you can't get hold of the author - you can try asking in the Logik forum at logik.tv
and ask whether anyone could help you debug a particular shader not working.