Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for JPEG MPF (Multi-Picture Format) file #746

Closed
carlcai opened this issue Jan 29, 2024 · 8 comments
Closed

Add support for JPEG MPF (Multi-Picture Format) file #746

carlcai opened this issue Jan 29, 2024 · 8 comments

Comments

@carlcai
Copy link

carlcai commented Jan 29, 2024

Hello,I want to support HDR gain maps,
A new "gain map" standard (https://helpx.adobe.com/camera-raw/using/gain-map.html) offers this.
There are some gain map examples under the Adobe link (direct download is https://www.adobe.com/go/gainmap_sample_photos).
And the supplied sample JPEG files with gainmaps are stored in JPEG MPF (Multi-Picture Format) files.
Relevant CIPA document on Multi-Picture Format: https://www.cipa.jp/std/documents/e/DC-X007_E.pdf

I found I can't extract the multiple images by libjpeg-turbo, Do libjpeg plan to support the MPF?

@dcommander
Copy link
Member

libjpeg-turbo is an ISO/ITU-T reference implementation of JPEG-1 and JFIF. I am open to supporting sanctioned format extensions, such as JPEG XT, that extend JPEG-1 in a backward-compatible way, but this is not that. It appears to be something that Adobe controls and has patented, so we could not legally include support for it under the current libjpeg-turbo licenses. Correct me if I've misunderstood something.

@dcommander dcommander closed this as not planned Won't fix, can't repro, duplicate, stale Jan 29, 2024
@dcommander
Copy link
Member

Sorry, I see now that you're asking whether we could support MPF, not whether we could support Adobe's gain map (which would have to be handled by higher-level software.)

@carlcai
Copy link
Author

carlcai commented Jan 29, 2024

Yes,I am asking for whether libjpeg-turbo could support MPF,Do libjpeg-turbo have plan to support MPF,or the latest version of libjpeg-turbo is supported MPF Now?

@dcommander
Copy link
Member

libjpeg-turbo does not currently support MPF. I need to look into the potential legal/standards issues that might be involved. We are an ISO/ITU-T reference codec, so there is a limited amount we can do to support format extensions that are not sanctioned by those standards bodies. However, I want to understand what the necessary changes would be at the codec level. It may be possible to do something straightforward that allows higher-level codecs to use libjpeg-turbo with MPF images without providing explicit support ourselves. Please be patient, as it will take time to research this.

@jreck
Copy link

jreck commented Jan 29, 2024

It may be possible to do something straightforward that allows higher-level codecs to use libjpeg-turbo with MPF images without providing explicit support ourselves.

The jpeg_save_marker API allows layering MPF handling on top of libjpeg-turbo. This is the approach used by Skia for Android & Chromium without modifications to libjpeg-turbo. The higher-level codec then parses the MPF payload to resolve offsets to feed back into libjpeg-turbo for secondary image decodes.

@dcommander
Copy link
Member

Given that it is already possible to handle MPF without modifications to libjpeg-turbo, I would prefer not to add specific support for MPF to libjpeg-turbo, since it is technically out of scope for our project. CIPA standards, including EXIF and MPF, are best handled at a higher level. I am open to extending libjpeg-turbo to make it easier to handle those standards, but that would require more specific technical suggestions from the user community.

@DichenZhang1
Copy link

Hi carlcai,

Technically Ultra HDR is not JPEG, it happens to be using JPEG for encoding base image and gainmap. Gainmap formats require different APIs / more flexibility, therefore Google developed libultrahdr which uses libjpeg-turbo, and abstracts the users as such. We also road mapped the libavif and libheif dependencies so that in the future it will support transcoding formats such as converting the JPEG based gainmap version to AVIF-10-bit-HLG version without gainmap etc. There are quite a few applications using libultrahdr in their backends as of today successfully.

Thank you!

@carlcai
Copy link
Author

carlcai commented Jan 30, 2024

ok,Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants