support cICP in PNG
Categories
(Core :: Graphics: ImageLib, defect)
Tracking
()
People
(Reporter: chris, Assigned: tnikkel)
References
Details
Attachments
(1 file)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:120.0) Gecko/20100101 Firefox/120.0
Steps to reproduce:
Run http://wpt.live/png/cicp-chunk.html
Actual results:
Fail
Expected results:
Pass
Chrome and Edge pass, Firefox and Safari fail
Several image formats such as AVIF and JPEG-XL use Coding Independent Code Points to label the colorspace of an image in only a few bytes, compared to 100 bytes or more for an ICC Profile. I see Firefox already has CICP support for AVIF
https://bugzilla.mozilla.org/show_bug.cgi?id=1723253
PNG Third Edition added a cICP chunk for this too.
https://w3c.github.io/PNG-spec/#cICP-chunk
Here is the relevant section of the Explainer we did for TAG review
https://github.com/w3c/PNG-spec/blob/main/Third_Edition_Explainer.md#hdr-support
In addition to labelling HDR images it also compactly labels the increasingly popular Display P3 colorspace, and BT.2020 which is common in screenshots from broadcast video content.
Content providers are awaiting interoperable cross-browser support to start using it in PNG images on the Web. It is implemented in Adobe Photoshop and in Darktable.
The referenced WPT is the first of several tests for cICP in PNG, and uses Display P3.
Comment 2•2 years ago
|
||
Put link from description on Win11x64 using FF build 120.0b4 and it failed, while on Chrome passed.
Marking issue as new, not sure if component is correct please update if otherwise. This issue is similar to bug 1862235 in case they are related. Thank you.
Comment 3•2 years ago
|
||
The severity field is not set for this bug.
:jteow, could you have a look please?
For more information, please visit BugBot documentation.
Updated•2 years ago
|
| Assignee | ||
Updated•2 years ago
|
Comment 4•2 years ago
|
||
The severity field is not set for this bug.
:tnikkel, could you have a look please?
For more information, please visit BugBot documentation.
| Assignee | ||
Updated•2 years ago
|
WPT test results for cICP in PNG shows passes in Chrome and in Edge. Safari is shown as failing, because it relies on macOS support and the version of macOS used on WPT is too old. It passes in local testing on macOS Sonoma.
Thus, the only browser now failing is Firefox.
There is another WPT, which checks that cICP correctly sets the colorspace for all frames of an animated PNG. This is passed by Chrome (and Edge)
https://wpt.fyi/results/png/apng/fDAT-inherits-cICP.html?label=experimental&label=master&aligned
Jon Bauman [:jbauman:] I see you did the CICP support for AVIF, would similar code also with for CICP in PNG?
I'm aware that some big industry players are waiting for universal cross-browser support before deploying, and this currently works in Blink and WebKit.
WPT test results for cICP in PNG now shows passes in Chrome, Edge and Safari; WPT updated the version of macOS used for testing.
| Assignee | ||
Comment 9•1 year ago
|
||
Most recent libpng update included native support for this so we don't need to fiddle with unknown chunks.
Updated•1 year ago
|
Comment 10•1 year ago
|
||
Comment 11•1 year ago
|
||
| bugherder | ||
| Reporter | ||
Comment 12•1 year ago
|
||
Great to see this landing.
In case it helps with testing, I made an updated version of pngcheck which supports cICP:
Updated•1 year ago
|
| Reporter | ||
Comment 13•1 year ago
|
||
Nightly 136.0a1 (2025-01-24) (64-bit) is still failing cICP tests like https://wpt.live/png/cicp-chunk.html is that expected?
| Assignee | ||
Comment 14•1 year ago
|
||
(In reply to chris from comment #13)
Nightly 136.0a1 (2025-01-24) (64-bit) is still failing cICP tests like https://wpt.live/png/cicp-chunk.html is that expected?
That is not expected since that test is run in our CI and it looks to be passing. Also I just https://wpt.live/png/cicp-chunk.html and it fails in Firefox beta (which does not have this fix) but passes in latest Nightly (which does have this fix). I checked on a mac and a Windows machine. So maybe it's something different about your machine? Perhaps the color profile?
| Reporter | ||
Comment 15•1 year ago
|
||
My earlier comment was in relation to the published wpt results (from 24 Jan). On 26 Jan these turned to passes for Firefox.
The test does still fail on my machine (which has a wide gamut screen; the WPT infrastructure is limited to sRGB).
| Reporter | ||
Comment 16•1 year ago
|
||
(In reply to chris from comment #15)
My earlier comment was in relation to the published wpt results (from 24 Jan). On 26 Jan these turned to passes for Firefox.
The test does still fail on my machine (which has a wide gamut screen; the WPT infrastructure is limited to sRGB).
The same test passes on the same machine, in Chrome Canary Version 134.0.6982.0 (Official Build) canary (64-bit). It is a Windows machine, so I can't run Safari on it.
| Assignee | ||
Updated•5 months ago
|
Description
•