Images copied to clipboard should not color managed directly
Categories
(Core :: Graphics: Color Management, defect, P3)
Tracking
()
People
(Reporter: aosmond, Unassigned)
References
(Blocks 1 open bug)
Details
We currently do color management for tagged images unless SurfaceFlags::NO_COLORSPACE_CONVERSION is used. We don't specify that flag when we copy an image on the clipboard, which means it will be color managed for that particular display. This may have unintended consequences.
On OS X, we get the surface for the image and put the pixel data into a CGImage:
https://searchfox.org/mozilla-central/rev/a4be2fbe9bd4f405c91cc16e4e3a80400f5a9301/widget/cocoa/nsClipboard.mm#513
We should get the pixel data without colorspace conversion and premultiplication, extract the ICC data and use CGColorSpaceCreateWithICCData in conjunction with the CGImage creation.
Similarly on Windows:
https://searchfox.org/mozilla-central/rev/a4be2fbe9bd4f405c91cc16e4e3a80400f5a9301/widget/windows/nsClipboard.cpp#471
https://searchfox.org/mozilla-central/rev/a4be2fbe9bd4f405c91cc16e4e3a80400f5a9301/widget/windows/nsDataObj.cpp#969
We need to get the ICC profile, and bind it to the reencoded image.
Similarly on Linux:
gdk_pixbuf_save can be used to bind an ICC profile to the image.
We also need to disable color management when drawing the vector image to a surface as well if color management mode is 1 (everything).
Updated•3 years ago
|
Comment 1•8 months ago
|
||
I'm still finding this (or something similar) an issue. If you somehow grab an image and reupload it using firefox the colour correction gets applied to the uploaded image. For example, go to Amazon photos, edit an image, save image, the image now has the colour correction baked in. This does not happen using Chrome.
When I created an example to upload I noticed that the example itself exhibited the issue.
Uploaded using Chrome: https://imgur.com/a/TaWhOoS
Uploaded using Firefox: https://imgur.com/a/wBbGyhj
Description
•