Re: [csswg-drafts] [css-color-4] Evaluate static gamut mapping algorithms for oklab/oklch spaces (#10579)

Okay, one thing that was bothering me about the Color.js testing of GMAs is that it isn't 100% fair as some algorithms are getting hit heavier by certain API calls of Color.js.

Björn and Edgeseeker bypass the Color.js conversion pipeline which has a lot of overhead. For instance, Björn's converts to linear RGB outside of of the Color.js API.

So optimizing Raytrace to do the same, we actually get faster results than Björn's.

Forcing 1000 gradient steps, ray-trace is shown to be noticeably faster.

![Image](https://github.com/user-attachments/assets/a880c9dc-fecf-4bd7-89cf-62ca04057088)

Here's the optimized preview: https://deploy-preview-21--color-apps.netlify.app/gamut-mapping/gradients?from=oklch%2890%25+.4+250%29&to=oklch%2840%25+.1+20%29

The optimizations can be seen here: https://github.com/color-js/apps/pull/21.

I imagine even the CSS approach could be sped up doing something similar.


-- 
GitHub Notification of comment by facelessuser
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10579#issuecomment-2955725578 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 9 June 2025 12:59:53 UTC