Firefox 计划支持:JPEG XL
Firefox intent to ship: JPEG XL

原始链接: https://groups.google.com/a/mozilla.org/g/dev-platform/c/3YMV4MS34KA/m/iqfJV5cXEQAJ

从 Firefox 157 版本开始,JPEG XL 解码功能将在所有平台上默认开启。该功能由基于 Rust 的 `jxl-rs` 库提供支持,此前一直处于 `image.jxl.enabled` 配置项的开发阶段。 原型设计阶段最初引发的性能担忧已通过集成多线程解码得到解决,基准测试显示其性能与 Safari 的实现方案具有竞争力。虽然 JXL 在处理较小文件时的性能略逊于其他图像格式,但它与 Blink 的实现保持了功能对等,支持动画和渐进式显示。尽管 HDR 图像目前会以 SDR 格式渲染,但该实现提供的色调映射效果优于其他格式。 目前已进行了全面的测试,包括用于验证正确性的 WPT 测试,以及针对分块解码、动画和损坏处理的 Gecko 特定测试。此外,解码器还经过了严格的安全模糊测试。此次发布符合 ISO/IEC 18181 标准,并建立在既有的中立标准立场和“有保留地满意”的 TAG 审查基础之上。

Mozilla 宣布计划支持 JPEG XL 图像格式,此前 Chromium 也采取了类似举措。这一进展标志着重大转变,因为 Mozilla 此前曾因原始 C++ 解码器的安全顾虑而抵制添加该格式。 Hacker News 社区对此反应积极,用户称赞 Mozilla 在内存安全实现方案出现之前坚持立场。评论者认为,这种谨慎的做法是负责任的决策,通过最小化潜在安全漏洞,最终有利于该格式的长期采用。讨论还涉及图像编码的技术未来,用户质疑浏览器未来是否会扩展支持以包含 JXL 编码功能。 总的来说,大家的共识是,这一延迟实现了更安全的集成,并最终避免了因仓促将安全性较低的版本引入浏览器而可能引发的负面影响。
相关文章

原文

As of Firefox 157 I intend to turn JPEG XL decoding on by default on all platforms. It has been developed behind image.jxl.enabled, which today is on by default on Nightly only, and has had a Firefox Labs checkbox on every channel since 152. The decoder is jxl-rs, in Rust.

Bug to turn on by default: https://bugzilla.mozilla.org/show_bug.cgi?id=2065096

Standard: ISO/IEC 18181, https://www.iso.org/standard/85066.html

Standards body: ISO/IEC

Platform coverage: all

Preference: image.jxl.enabled

Standards position: https://github.com/mozilla/standards-positions/issues/522 (neutral)

TAG review: https://github.com/w3ctag/design-reviews/issues/633 (satisfied with concerns)

Intent to prototype: https://groups.google.com/a/mozilla.org/d/msgid/dev-platform/53b4e3e0-5eee-4768-a1ba-b069e1e85244n%40mozilla.org

Other browsers: Safari shipped in 17.0 in 2023. Chrome has it behind #enable-jxl-image-format using the same Rust library, no intent to ship yet.

Changes since the intent to prototype:

Performance was a concern raised on the intent to prototype thread. jxl-rs 0.6.0 was released with multithreaded decoding support, and our patches to hook up and enable multithreaded decoding are expected to land soon. Including those patches, I ran a five-format decode benchmark over the same pictures at a range of sizes: we were slightly ahead of Safari (using C++ libjxl) on my machine. Compared to our other image format decoders, JXL is close on large images, but shows a bigger gap on small ones.

It has feature parity with our other image formats and with Blink's JXL implementation, including animation and progressive display. The one exception is HDR: HDR images display as SDR, the same as every other format we support, but our tone mapping for JXL is much better than what we do for other image formats. Safari has neither progressive rendering nor animation.

The wpt jpegxl directory covers decode correctness across bit depths, alpha, grayscale, CMYK, colour management, orientation and the coding tools, plus the HTML and CSS ways an image gets used. Where wpt could not express something I added gecko tests: about 30 gtests for chunked and incremental decoding, animation frame counts, downscale during decode and corrupt files, mochitests for progressive rendering and telemetry, reftests, and decode benchmarks that report to Perfherder. The fuzzing team already fuzzed jxl before it was enabled on nightly and they will fuzz the decoder again before I flip the pref.

Timothy Nikkel


联系我们 contact @ memedata.com