-
Notifications
You must be signed in to change notification settings - Fork 35
-
Björn Ottosson proposes some here: https://bottosson.github.io/posts/gamutclipping/
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
Things I like compared to clampChroma:
- obviously, the ability to clamp L and chroma both. And adaptively.
- an actual
find_gamut_intersectionfunction instead of bisection. this function, in this form, exploits how Oklch gives those triangular slices with the sRGB gamut; it should be possible to fit all non-HDR RGB color spaces this way, as the only condition for these slices to appear seems to be having the same L range as sRGB.
Yep, they do have the same L range. Node repl:
> const culori = await import("culori");
undefined
> console.log(culori.converter('oklab')(culori.parse("color(display-p3 1 1 1)")))
{
mode: 'oklab',
l: 0.999999993473546,
a: 8.095307757471915e-11,
b: 3.727390751606663e-8
}
undefined
> console.log(culori.converter('oklab')(culori.parse("color(display-p3 0 0 0)")))
{ mode: 'oklab', l: 0, a: 0, b: 0 }
undefined
> console.log(culori.converter('oklab')(culori.parse("color(display-p3 1 1 1)"))
> console.log(culori.converter('oklab')(culori.parse("color(rec2020 0 0 0)")))
{ mode: 'oklab', l: 0, a: 0, b: 0 }
undefined
> console.log(culori.converter('oklab')(culori.parse("color(rec2020 1 1 1)")))
{
mode: 'oklab',
l: 0.9999999934735462,
a: 8.095329961932407e-11,
b: 3.727390762708893e-8
}
undefined
>
Beta Was this translation helpful? Give feedback.
All reactions
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment