Closed Bug 2034984 Opened 6 months ago Closed 6 months ago

change how jxl decoder does color management

Categories

(Core :: Graphics: ImageLib, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
152 Branch
Tracking Status
firefox152 --- fixed

People

(Reporter: tnikkel, Assigned: tnikkel)

References

(Blocks 2 open bugs)

Details

Attachments

(4 external files, 1 obsolete file)

No description provided.

We move away from getting jxl-rs passing us f32 buffers to do color management as part of it's decoding process before it hands us the final buffer, which is a pattern that none of our other image decoders follows.

We move towards a model where jxl-rs passes us a final buffer in a color space that it informs us of, and we can then perform further color management on it to the desired final space. There is one new wrinkle: we ask jxl-rs to gives us f16 data for hdr images, and then we convert it to u8 before passing it to the usual surface pipe. (This part is actually very similar to how we do cmyk and grayscale color management in the decoder before the surface pipe in the jpeg, png, and avif decoders.) I'm told this is also similar to how chromium's jxl decoder works.

Attachment #9573768 - Attachment is obsolete: true
Pushed by tnikkel@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/e8773825367c https://hg.mozilla.org/integration/autoland/rev/8c68ea593849 Remove internal CMS adapter from jxl-rs; simplify jxl_decoder_new API. r=saschanaz https://github.com/mozilla-firefox/firefox/commit/0604f3cc3697 https://hg.mozilla.org/integration/autoland/rev/9b9ba62b6d5d Add per-pixel-format detection and infrastructure to jxl decoder. r=saschanaz https://github.com/mozilla-firefox/firefox/commit/bae1c8f3a450 https://hg.mozilla.org/integration/autoland/rev/698d777a7344 Add per-format pixel conversion and CMS wiring in C++ jxl decoder. r=saschanaz https://github.com/mozilla-firefox/firefox/commit/0e9724f81f5e https://hg.mozilla.org/integration/autoland/rev/0c77f2770f45 In the jxl decoder make sure to apply color management before premultiplying alpha. r=saschanaz
Pushed by agoloman@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/eb1ea027c50b https://hg.mozilla.org/integration/autoland/rev/d6592d369b3b Revert "Bug 2034984, Bug 2034983. In the jxl decoder make sure to apply color management before premultiplying alpha. r=saschanaz" for causing gtest failures @BlendJXLWithFilter.

Backed out for causing gtest failures @BlendJXLWithFilter.

Flags: needinfo?(tnikkel)
Depends on: 2036329

BlendJXLWithFilter just needs fuzz of 1, but there is actually a bigger issue in the linux tsan gtests -> bug 2036329 for that.

Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/59609 for changes under testing/web-platform/tests

Upstream PR merged by moz-wptsync-bot

Pushed by tnikkel@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/b5a600b11957 https://hg.mozilla.org/integration/autoland/rev/4af4144d7aae Remove internal CMS adapter from jxl-rs; simplify jxl_decoder_new API. r=saschanaz https://github.com/mozilla-firefox/firefox/commit/68bae1f3853c https://hg.mozilla.org/integration/autoland/rev/294e82aa14b6 Add per-pixel-format detection and infrastructure to jxl decoder. r=saschanaz https://github.com/mozilla-firefox/firefox/commit/c47523165998 https://hg.mozilla.org/integration/autoland/rev/5b9f2d7b3d60 Add per-format pixel conversion and CMS wiring in C++ jxl decoder. r=saschanaz https://github.com/mozilla-firefox/firefox/commit/e4cd22188a2e https://hg.mozilla.org/integration/autoland/rev/320f545118d7 In the jxl decoder make sure to apply color management before premultiplying alpha. r=saschanaz
Flags: needinfo?(tnikkel)

Backed out for causing rust failures.

Pushed by tnikkel@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/c872dea6f82c https://hg.mozilla.org/integration/autoland/rev/c0719c236dc8 Remove internal CMS adapter from jxl-rs; simplify jxl_decoder_new API. r=saschanaz https://github.com/mozilla-firefox/firefox/commit/c28167ab5e92 https://hg.mozilla.org/integration/autoland/rev/547f7fc58daa Add per-pixel-format detection and infrastructure to jxl decoder. r=saschanaz https://github.com/mozilla-firefox/firefox/commit/c781cd065b9e https://hg.mozilla.org/integration/autoland/rev/5af1605158ff Add per-format pixel conversion and CMS wiring in C++ jxl decoder. r=saschanaz https://github.com/mozilla-firefox/firefox/commit/167c84616258 https://hg.mozilla.org/integration/autoland/rev/2ff1e151db6e In the jxl decoder make sure to apply color management before premultiplying alpha. r=saschanaz
Blocks: 1993906
Regressions: 2037822
Blocks: 1709857

Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/60007 for changes under testing/web-platform/tests

Upstream PR merged by moz-wptsync-bot

QA Whiteboard: [qa-triage-done-c153/b152]
Duplicate of this bug: 2028869
Regressions: CVE-2026-16402
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: