A variation on Jed's RGB gamut mapper

Hi,

@nick, what an elegant piece you wrote there, nice RGB Ratio Kung Fu :-).
You map max and min on 0 and 1 so you can scale the middle component, very smart.

Some initial thoughts:

I guess the most noticeable thing is that your approach does not drift towards the primaries. In @jedsmith work, the compression function brings the two non-max components closer to each other, which is a hue-skew towards the primary defined by max(RGB).

The primaries location are the points furthest away from the white point, for each hue. This means compressing towards them is a “space-efficient” way of squeezing out of gamut colours in gamut. Also, the distance from the primaries to the white point is different for each hue. I found that the hue preserving gamut mapping is a bit harder to set up, as there is no way to bias the gamut mapping directions (like with the CMY weights).

Then on the other side, you have a hue-preserving gamut compression.
We need to find out for which use-cases that would be a beneficial property.

I will play with it more next week.

Great job.
Daniele

6 Likes