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

Incorrect results with wide gamut images #266

Open
LeaVerou opened this issue Oct 12, 2024 · 0 comments
Open

Incorrect results with wide gamut images #266

LeaVerou opened this issue Oct 12, 2024 · 0 comments

Comments

@LeaVerou
Copy link

LeaVerou commented Oct 12, 2024

Hello there! Thank you for making this awesome library!

I was reading the docs and noticed that colors are returned as arrays of integers, presumably assuming sRGB. How does this work with images tagged with a color profile, including colors outside sRGB?

Here's an example with two swatches, an sRGB red and a P3 red.

reds

Trying it on the website seems to produce strange results such as rgb(252, 4, 4) and rgb(256, 4, 4), repeated multiple times.

If you're using <canvas> to measure the colors, there is a display-p3 mode, though I'm not sure how to detect tagged images. As an MVP, it could expose an option that users can set and just passes it through to the canvas context.

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

No branches or pull requests

1 participant