# Gamut mapping compression curves

**URL:** <https://community.acescentral.com/t/gamut-mapping-compression-curves/3073>\
**Category:** VWG – Gamut Compression/Mapping\
**Created:** [June 9, 2020, 8:12pm UTC](https://community.acescentral.com/t/gamut-mapping-compression-curves/3073 "2020-06-09T20:12:03Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Thomas\_Mansencal](https://community.acescentral.com/user_avatar/community.acescentral.com/thomas_mansencal/32/144_2.png) [@Thomas\_Mansencal](https://community.acescentral.com/u/Thomas_Mansencal)\
**Post date:** [June 10, 2020, 7:18pm UTC](https://community.acescentral.com/t/gamut-mapping-compression-curves/3073/4 "2020-06-10T19:18:42Z")

</div>

> [@RGB Saturation Gamut Mapping Approach and a Comp/VFX Perspective](https://community.acescentral.com/t/rgb-saturation-gamut-mapping-approach-and-a-comp-vfx-perspective/2715/105):
>
> I believe that preservation of “color purity” or “saturation” is a by-product of the threshold, not the compression function.

There should not be real surprise that by fiddling with the parametrisation the curves will eventually produce an output relatively similar for a given domain, they all share the sigmoid trait.

The good function is the one that preserves purity at the highest possible limit, i.e. not a small domain, while being free of defects.

I’m tempted to say that if anything, your images show that `tanh` is almost ideal over a small distance 😋

> [@RGB Saturation Gamut Mapping Approach and a Comp/VFX Perspective](https://community.acescentral.com/t/rgb-saturation-gamut-mapping-approach-and-a-comp-vfx-perspective/2715/105):
>
> I’m not sure if this is a by-product of the lack of C2 continuity or just the more abrupt transition of the curve from linear to compressed.)

C2 continuity will guarantee identical curvature at the graft point which prevents steep slope from the function you are appending. B-Splines are C2 continuous so as mentioned somewhere above we could also look into that but I don’t feel like it is warranted and it would certainly complexify the implementation.

Something to keep in mind is that the numbers I gave above (along those extended by @JamesEggleton) are for HalfFloat computations thus it is extreme case scenario as high quality image processing will happen with at least single-precision 32-bit representation. There are of course real-time applications that use HalfFloat happily for processing but in the context of this group this is no-concern.

I will re-run the notebook with Float32, hopefully the Colab VM does not run out of ram 😄

---

_[View the full topic](https://community.acescentral.com/t/gamut-mapping-compression-curves/3073)._
