Open Bug 1821750 Opened 2 years ago Updated 2 years ago

png spec third edition updates

Categories

(Core :: Graphics: ImageLib, enhancement)

enhancement

Tracking

()

People

(Reporter: cblume, Unassigned)

References

(Depends on 1 open bug)

Details

Steps to reproduce:

I have been working with others in the W3C PNG WG on the upcoming PNG spec Third Edition. This addresses some errata of Second Edition as well as adds some new functionality.

Actual results:

The draft spec (https://github.com/w3c/PNG-spec) has changed. I suggest Firefox's PNG codec change as well to reflect the new spec.

Expected results:

There are several changes. This bug is really to start a conversation about what the Firefox team wants to do and how to move forward. Perhaps this can also serve as a meta-bug for each individual change?

I can provide a breakdown of high-level changes. I am also adding WPT tests under png/. But not all changes can result in a WPT test.

What does the Firefox team want to help with this?

Component: Untriaged → Graphics: ImageLib
Product: Firefox → Core
Status: UNCONFIRMED → NEW
Ever confirmed: true

From https://www.w3.org/TR/png-3/#changes-since-the-w3c-recommendation-of-10-november-2003-png-second-edition it looks like there are 2 main changes that might affect firefox:
-cICP chunks for HDR/WCG
-exif

And apng changes we should already be inline with?

I wasn't aware that exif in png was widespread, I thought it was still somewhat limited use.

Is all that correct? Did I miss anything?

We have bug 1627423 already on file for exif in png. Not sure if we have anythign for cICP.

Thanks for opening a dialog. Happy to discuss this with you.

Depends on: 1627423

The link you provided was for the First Public Working Draft (FPWD). There have been additions since then. See https://w3c.github.io/PNG-spec/#changes-20221025

You are right about cICP, exif, and APNG.
The changes since FPWD include mLUm and mDCv chunks. These are useful for tone mapping.

Another thing to note is the spec now has tighter wording around the tRNS and bKGD chunks. If an image is 8-bits per channel (non-indexed), those chunks will still use 16-bits per channel to describe their colors. Only the low 8 bits should be used. Previously, the spec was vague about whether it was an error for the high bits to contain non-zero. Firefox chose to treat it as an error and not display the image. libpng chose to issue a warning. The spec is now more firm that the high bits should be ignored, so Firefox should now display these images. The discussion on it can be found at https://github.com/w3c/PNG-spec/issues/29 and a WPT test is in https://wpt.fyi/results/png?label=master&label=experimental&aligned&view=subtest&q=png

Note that the 3rd Edition isn't yet a Recommendation. Our next step is to move from FPWD to Candidate Recommendation (CR). Part of the CR step is collecting implementation stories. For example, were some parts unrealistic to implement? That is why I opened this bug.

We would love to hear your feedback. Including participation in the WG if you are interested.

You need to log in before you can comment on or make changes to this bug.