home | download | howto | module docs | git | beta

okgmtclp: experimental gamut clipping in oklab space using Bjorn Ottosson's methods

this module implements Björn Ottosson's Oklab gamut clipping methods https://bottosson.github.io/posts/gamutclipping/. Some additional commentary can be found on Simon's Tech Blog

this module tries to clip out-of-gamut colors by pulling them back into gamut along a perceptually uniform line.

parameters

connectors

technical

a large shortcoming of this method is that the oklab color space does not accurately map imaginary colors. in other words, colors that fall outside the spectral locus or above visibly possible are meaningless and thus may get clipped to a color that in not of similar hue or chroma. though it has similar shortcomings, you can consider the colour module's built in gamut mapping if this module is not working for your use case.

credits

Simon Yeung's Shader visualization https://www.shadertoy.com/view/7tlGRS

Björn Ottosson's Oklab gamut clipping methods: https://bottosson.github.io/posts/gamutclipping/

October 2026