gamut_mapping: add tonal gamut-mapping function
Based on a radically new approach of transforming hue leaves into a new bespoke colorspace called "tone saturation hue", which is designed to represent colors in a hue-leaf-relative representation.
Every color with a tone (T) parameter above 0.0 is subjectively brighter than the maximally saturated color of this hue, while every color with a tone below 0.0 is subjectively darker. This means that all colors crossing the T=0.0 plane are basically on the same intensity as the maximally saturated color for that hue.
Similarly, the saturation (S) parameter has been normalized so that S=1.0 always corresponds to the maximally saturated color of that hue leaf. So all of the vertices of the RGB cube have S=1 T=0, with differing values of hue.
This is combined with a simple quadratic rolloff to protect the in-gamut region from being warped, resulting in a nice, smooth colorimetric mapping.
Provided in both a hue-preserving and hue-shifting variant. Usefulness TBD.
Merge request reports
Activity
added 9 commits
-
b85f9666...e6a89f31 - 2 commits from branch
videolan:master
- 60f6a2ab - gamut_mapping: fix hue shift margin direction
- 852a8822 - gamut_mapping: factor out hue shifting code
- 7270e772 - gamut_mapping: safety clamp on desat_bounded()
- 30506060 - gamut_mapping: protect against UB in softclip()
- b721bd3c - gamut_mapping: make strength of hue shift tweakable
- 1d1c87f6 - gamut_mapping: add tonal gamut-mapping function
- 26c791e6 - gamut_mapping: slightly reduce hue shifting strength
Toggle commit list-
b85f9666...e6a89f31 - 2 commits from branch
added 6 commits
-
f53badbb - 1 commit from branch
videolan:master
- 0c17fc02 - gamut_mapping: fix hue shift margin direction
- 049a8689 - gamut_mapping: factor out hue shifting code
- f40bd853 - gamut_mapping: safety clamp on desat_bounded()
- 5307129b - gamut_mapping: protect against UB in softclip()
- 167f1da2 - gamut_mapping: add tonal gamut-mapping function
Toggle commit list-
f53badbb - 1 commit from branch
added 1 commit
- dd3beb16 - gamut_mapping: add tonal gamut-mapping function
added 1 commit
- 4b4a1c56 - gamut_mapping: add tonal gamut-mapping function
So, I'm considering axing the 'tonal' name and instead making this the new
perceptual
, with a rebrand of the oldperceptual
tosoftclip
.The reason is that I simply think this is the best quality by far, works bidirectionally (and looks great while doing so), fixes some issues
perceptual
had, makes most highlights much less 'desaturated', and overall comes closer in spirit to what a 'perceptual' mode should be.mentioned in merge request !501 (closed)
added 6 commits
-
b7c9e9c2 - 1 commit from branch
videolan:master
- 96d62742 - gamut_mapping: fix hue shift margin direction
- ba50373c - gamut_mapping: factor out hue shifting code
- c3ea00e6 - gamut_mapping: safety clamp on desat_bounded()
- 29aeb94e - gamut_mapping: protect against UB in softclip()
- 98f46bad - gamut_mapping: add tonal gamut-mapping function
Toggle commit list-
b7c9e9c2 - 1 commit from branch
mentioned in merge request !516 (merged)