Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Gamut mapping App] Add port of Chromium Gamut mapping app #485

Merged
merged 5 commits into from
Mar 20, 2024

Conversation

jamesnw
Copy link
Contributor

@jamesnw jamesnw commented Mar 14, 2024

This ports the algorithm available behind a flag in Chrome Canary, implemented here.

The approach appears to be different from the others, reach roughly the same results as the CSS algorithm, and is as fast as clip.

I expect that there could be additional cleanup, this was intended to be as straight of a port as possible from the original code.

  • Verify what color space it is mapping to - rec2020
  • Don't map in-gamut colors
  • Can produce colors out of p3 gamut- should it be clipped? Added clip to rec2020.

Copy link

netlify bot commented Mar 14, 2024

Deploy Preview for colorjs ready!

Name Link
🔨 Latest commit 97311b0
🔍 Latest deploy log https://app.netlify.com/sites/colorjs/deploys/65f9cd1b7ac7410008912913
😎 Deploy Preview https://deploy-preview-485--colorjs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@LeaVerou
Copy link
Member

Wow, thanks for this! Why the change from chromium to baked-in? I thought chromium was more accurate.

@jamesnw
Copy link
Contributor Author

jamesnw commented Mar 15, 2024

Wow, thanks for this! Why the change from chromium to baked-in? I thought chromium was more accurate.

The issue & description refer to it as "baked in", so I thought I would mirror the other methods, and name this by the methodology rather than source. I suspect there to be a large number of variations on what "baked-in" means, so if we add additional ones, we may want to add the provenance, e.g., Baked in- Chromium, oklab to rec2020.

@facelessuser
Copy link
Collaborator

I do think for comparison purposes, this approach should clip to Display P3. Right now, you are comparing P3 deltas with Chromiums Rec. 2020 deltas, which makes the whole thing unhelpful. Visually, the browser will clip to whatever the display is using, but for raw number comparison purposes, we need actual P3 values.

@jamesnw
Copy link
Contributor Author

jamesnw commented Mar 19, 2024

@facelessuser Good point- update pushed!

@facelessuser
Copy link
Collaborator

I have no opinions on name. As a suggestion, you could call it chromium and reference the "baked-in" part in the description. Other than that, it all LGTM at this point.

@jamesnw
Copy link
Contributor Author

jamesnw commented Mar 19, 2024

As a suggestion, you could call it chromium and reference the "baked-in" part in the description.

Good idea- done!

@facelessuser
Copy link
Collaborator

I think all of the issues everyone had have been addressed. It seems to yield the same results that Chromium does when the GMA flag is enabled as well. Since this doesn't affect core code at all, I will go ahead and merge this.

@facelessuser facelessuser merged commit 2e6d186 into color-js:main Mar 20, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants