Skip to content

Incorrect results with wide gamut images #266

@LeaVerou

Description

@LeaVerou

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions