Skip to content
Snippets Groups Projects

gamut_mapping: add tonal gamut-mapping function

Closed Niklas Haas requested to merge haasn/libplacebo:tonal_shift into master

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

Pipeline #369354 passed

Pipeline passed for 98f46bad on haasn:tonal_shift

Test coverage 80.25% (0.03%) from 1 job
Approval is optional

Closed by Niklas HaasNiklas Haas 1 year ago (Aug 1, 2023 11:46am UTC)

Merge details

  • The changes were not merged into master.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading