HDR Gain Maps and MP Data

Started by blue-j, April 10, 2025, 08:56:24 PM

Previous topic - Next topic

blue-j

So, no one in the FOSS community has been able to figure out how to resize a JPEG with an HDR gain map embedded, while retaining the gain map and its related data.

References:
https://helpx.adobe.com/camera-raw/using/gain-map.html

https://www.exiftool.org/TagNames/XMP.html#hdrgm

https://exiftool.org/TagNames/MPF.html

Latest Multi-Picture Format specification (2021) attached for reference.  Phil - not sure you have this revision?

One workaround would be to extract the gain map and its metadata using ExifTool, resizing the source image, then reinserting the gain map and metadata, edited to match the new image dimensions.

Is this a tractable proposal?  Has anyone done this out there?

- J



Phil Harvey

I do have the latest MPF specification, but nothing has really changed since the 2009 spec.

ExifTool doesn't write MPF primarily because the specification made a big mistake in my opinion.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

blue-j

oh man.  i stepped in it here.  i think i'll bring this to eric's attention at adobe to see if that's helpful in any way.  it's an enormous problem facing the gain map standard, IMO.  maybe the ISO committee has already run into it.  - J

blue-j

eric wrote:

"Doing in-place updates of MPO files can be challenging, because of the need to update the offsets in the MP header. 

However, writing a new MPO file (containing edited content, derived from the original MPO file) should not be an issue, because the content (including the header and offset) is created from scratch.  You would need to know in advance the size of each individual image (e.g., base image, and gain map) to be able to compute the offset to store in the header.

Do you have a copy of the CIPA MPF document?  (DC-007).  The internal structure of the MP Index IFD indicates how the individual images are referenced/indexed in the header."

FWIW

Phil Harvey

Yes I have this specification.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

StarGeek

Quote from: blue-j on April 13, 2025, 01:22:37 AMDo you have a copy of the CIPA MPF document?  (DC-007).

I had to double-check, but a copy of this on Archive.org is linked on the Multi-Picture Format tags page.

Checking CIPA, there was a a revision in January. A draft copy was available back in November 2024 at the very least, as I already had a copy of draft.

Revisions
Quote►Added individual image types that can be recorded in Baseline MP files ([5.2.3.3.1] and [6.1])
- Added classes supporting higher number of pixels to the sub-type of large thumbnail image
- Added "original preservation image" specified by Exif (normative reference 1)
- Added "gain map image" specified by ISO 21496-1 (normative reference 3)
►Updated/added normative references
►Improved explanations
- Added descriptions to Tables 1 and 4 to help to understand the respective definitions of Baseline MP file and Extended MP file, and the individual image types able to be had in each MP file
►Throughout
- Updated subsequent table numbers along with the addition of Table 9
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

blue-j

Oh great, StarGeek!  Thank you for this.  They seem to have incorporated gain map images.  I'll have a chance to review soon.  - J

Phil Harvey

Thanks StarGeek.  I'll add the new definitions from the latest MPF spec.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).