Request sRGB images when drawing an image in Canvas
Categories
(Core :: Graphics: Color Management, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox89 | --- | affected |
People
(Reporter: jrmuizel, Assigned: jrmuizel)
References
(Depends on 1 open bug, Blocks 2 open bugs)
Details
Attachments
(2 files)
This will avoid the problem in bug 1631615 where untagged images get converted to device space screwing up the colors. It will also mean that the same data shows up in canvas regardless of the display profile.
Assignee | ||
Comment 1•4 years ago
|
||
Updated•4 years ago
|
Comment 3•4 years ago
|
||
bugherder |
Assignee | ||
Comment 4•3 years ago
|
||
I've requested this be backed out from central. Pascal, can you back it up from 89?
Comment 5•3 years ago
|
||
Comment 7•3 years ago
|
||
Sebastian, Jeff, what's the status of the backout for 90/91 here? AFAICT only the backout in 89 landed.
Assignee | ||
Comment 8•3 years ago
|
||
This will need to be backed out of 90 and 91
Comment 10•3 years ago
|
||
Backout merged: https://hg.mozilla.org/mozilla-central/rev/f4fcaad7e44a
Comment 11•3 years ago
|
||
uplift |
Backed out from beta: https://hg.mozilla.org/releases/mozilla-beta/rev/903bfb00beb807882a1a92edcff34d81fdc8d7cb
Comment 12•3 years ago
|
||
I have a project that utilizes a canvas and have a couple of questions about the intended implementation of this change.
-
Currently, because canvases get treated as being in the device space (and input images are converted to that space when they are added to the canvas), the end result is that color management works mostly correctly for canvases. (It's only a problem if the page then depends on the data in the Canvas having precise values, see Bug 1631615.) With this change, images added to the canvas will be sRGB instead, so untagged images will not have modified canvas data. Sounds good. But is the canvas then treated as sRGB when composited so that it will be properly color managed in the display space? Or is it unmanaged, meaning that since the data is sRGB, canvases will end up being heavily oversaturated on WCG displays?
-
Standardizing canvases on the sRGB space will amount to a regression for wide gamut image support, which as far as I know currently "just work" (because the canvas targets the display space). Furthermore, it sounds to me like this will make it harder to support HDR in canvases in the future. (I have similar concerns about inputs being converted to sRGB on macOS as in Bug 1696688, although fortunately this change hasn't been adopted for other platforms.) What's the plan in terms of future-proofing Firefox's implementation of canvases and color management more generally?
Thanks!
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 13•2 years ago
|
||
(In reply to Adam Fontenot from comment #12)
I have a project that utilizes a canvas and have a couple of questions about the intended implementation of this change.
- Currently, because canvases get treated as being in the device space (and input images are converted to that space when they are added to the canvas), the end result is that color management works mostly correctly for canvases. (It's only a problem if the page then depends on the data in the Canvas having precise values, see Bug 1631615.) With this change, images added to the canvas will be sRGB instead, so untagged images will not have modified canvas data. Sounds good. But is the canvas then treated as sRGB when composited so that it will be properly color managed in the display space? Or is it unmanaged, meaning that since the data is sRGB, canvases will end up being heavily oversaturated on WCG displays?
On macOS canvas is properly color managed. On other platforms it is unmanaged and so images will end up being heavily oversaturated.
- Standardizing canvases on the sRGB space will amount to a regression for wide gamut image support, which as far as I know currently "just work" (because the canvas targets the display space). Furthermore, it sounds to me like this will make it harder to support HDR in canvases in the future. (I have similar concerns about inputs being converted to sRGB on macOS as in Bug 1696688, although fortunately this change hasn't been adopted for other platforms.) What's the plan in terms of future-proofing Firefox's implementation of canvases and color management more generally?
Yes, this will be a regression for wide gamut image support. In the future, Firefox will properly color management sRGB canvases on other platforms and will support the colorSpace
context attribute which will allow constructing a display-p3
canvas.
Comment 14•2 years ago
|
||
This blocks S2 bug 1797902.
What's the status here?
Comment 15•2 years ago
|
||
At least a fix for bug 1708989 (other than backing out this bug) is needed, which I plan to do shortly.
Comment 16•2 years ago
|
||
(In reply to Jeff Muizelaar [:jrmuizel] from comment #13)
On macOS canvas is properly color managed. On other platforms it is unmanaged and so images will end up being heavily oversaturated.
Thanks for the reply. Just my opinion - this strikes me as a very serious regression that should be reconsidered. Going from "WCG and color management mostly works on canvases" to "WCG and color management don't work at all on canvases" for both the Windows and Linux platforms purely for the sake of fixing a different bug seems like a bad move.
Given that this bug has been open almost two years, it seems fair to say that it's not really a priority. Wouldn't it make sense to delay this change until canvases can be properly tagged as sRGB and color managed, fixing that half of the problem at least? Seems to me that releasing a version of this with extremely oversaturated images on canvases is going to result in obvious, public breakage for a lot of sites that use <canvas> in Firefox.
It will be sad to (hopefully temporarily) lose WCG support, but at least that part of it will be invisible to most users.
Assignee | ||
Comment 17•2 years ago
|
||
I've also adjusted severity of 1797902
Assignee | ||
Updated•2 years ago
|
Description
•