Gain maps in JPEG XL (jhgm box, libjxl 0.11)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- c
调研方向
Read the existing jxlload and jxlsave paths, then compare how uhdrload and uhdrsave attach and preserve gain-map data. Check libjxl 0.11's jxl/gain_map.h and the existing EXIF and XMP box handling; done means JPEG XL load and save preserve the jhgm gain-map box, including conversion from another format.
由索引模型根据 Issue 内容生成。
描述
Discussed in https://github.com/libvips/libvips/discussions/5272
Originally posted by tina-junold October 27, 2026
libvips 8.18 keeps the gain map of Ultra HDR JPEG images through uhdrload and uhdrsave, and #5186 covers AVIF and HEIF through libultrahdr 2. libultrahdr doesn't handle JPEG XL, though, while libjxl has supported gain maps on its own since 0.11.
What libjxl provides
jxl/gain_map.h (libjxl 0.11, e.g. 0.11.2 in Debian trixie) reads and writes the jhgm box: a JxlGainMapBundle holds the ISO 21496-1 metadata as a binary blob, an optional alternative color encoding or ICC profile, and the gain map itself as a JPEG XL codestream. JxlGainMapWriteBundle / JxlGainMapReadBundle serialize it, and the box is written with JxlEncoderAddBox like the EXIF and XMP boxes jxlsave writes already, or read from the box events of the decoder.
What it could look like in libvips
Following the JPEG path:
jxlloadattaches the gain map and its metadata when the image has ajhgmbox, likeuhdrloaddoes withgainmap-dataand thegainmap-*fields, sovips_image_get_gainmap()andthumbnailwork on JPEG XL images as well;jxlsavewrites ajhgmbox when the image has a gain map, keeping it withkeep=gainmap, and recompresses it as a JPEG XL codestream if it came from another format, e.g. an Ultra HDR JPEG saved as JPEG XL.
The metadata in the box is ISO 21496-1, the same as in Ultra HDR JPEG and the ISO gain maps of AVIF and HEIF, so the gainmap-* fields would mean the same for every format.
Why
Phones write gain maps (Android as Ultra HDR JPEG, iPhones as JPEG and HEIC), and JPEG XL is gaining browser support. Today an Ultra HDR JPEG saved as JPEG XL with libvips loses its HDR, unless it is converted to scRGB, which drops the SDR rendition. For example, an image service built on libvips which transforms the gain map along with the image, like thumbnail does, can only offer HDR for JPEG output so far.
- 主要语言
- C
- 星标
- 11.9k
- 派生
- 811
- 平均合并
- 1 天 6 小时
- 30 天内合并 PR
- 44
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
libvips/libvips 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
enhancement
难度 4/5 3-5 天 新手友好度 25/100
维护者通常 1 天内回复
-
enhancement
难度 5/5 一周以上 新手友好度 35/100
维护者通常 1 天内回复
-
enhancement
难度 5/5 一周以上 新手友好度 35/100
libvips/libvips#5297 · 5 条评论 ·
维护者通常 1 天内回复
-
enhancement
难度 4/5 3-5 天 新手友好度 48/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
Make the HTTP server's keep-alive and headers timeouts configurable可能已有人在做 @mattgodbolt 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
compiler-explorer/compiler-explorer#9902 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
timescale/pg_vectorsearch#446 ·
维护者通常 1 天内回复
-
[BUG] msetcfg accepts unsupported mcfg encodings可能已有人在做 @BinaryBardY 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
OpenXiangShan/NEMU#1319 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
signalwire/freeswitch#3329 ·
维护者通常 1 天内回复