Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Explore other clamping techniques #136

danburzo started this conversation in Ideas
Discussion options

Björn Ottosson proposes some here: https://bottosson.github.io/posts/gamutclipping/

You must be logged in to vote

Replies: 1 comment

Comment options

Things I like compared to clampChroma:

  • obviously, the ability to clamp L and chroma both. And adaptively.
  • an actual find_gamut_intersection function 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
>
You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
Research Further reading / things to look into
Converted from issue

This discussion was converted from issue #112 on July 31, 2021 14:29.

AltStyle によって変換されたページ (->オリジナル) /