-
-
Notifications
You must be signed in to change notification settings - Fork 304
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
Canon HIF (10 bit) Conversion to JPG : Tone Mapping & EXIF #1183
Comments
Can you attach the file instead? Zip it if needed. |
I have downloaded the image: issue-1183-data.zip The image contains no auxiliary tone-mapping image, just standard EXIF and XMP metadata. The NCLX color profile says that it uses a PQ transfer characteristic, which is probably the reason that the image looks dull when it is not taken care of. During the conversion to JPEG, libheif does not modify the image data itself. The EXIF is preserved, but the NCLX data is lost. The question is: should libheif handle the color profile conversion? This may still be doable for simple things like here, but when we want to also convert between attached ICC profiles, we would need to use |
Please find it attached : |
There are so many creative choices and trade-offs to be made when doing the tone and gamut mapping, that makes it IMHO out of scope for a file format library. libjxl is actually doing this (I guess there might be a "recommended" tone mapper in some ITU/Dolby/etc. doc), but I still feel this should be abstracted out of a file format library and shared as a separate black box library... Otherwise, we'll end up w/ a tone/gamut mapper each in libjxl, libheif, libavif, and libpng (also now supports CICP HDR profiles for >8bpp). P.S. Also note that libjxl is doing this internally in float representation... |
If anything, libheif should just throw a warning if saving to JPEG w/ anything other than sRGB if ICC is not available. Long term, perhaps support Ultra HDR JPEGs via libultrahdr... |
Yes, I agree on the tone mapping and ICC side. This should just be passed through and we can output a warning in |
AFAIK, there is none (other than the TRC inside an ICC). That's why I said, if there is no ICC in the original HEIF, one should just give up (and suggest converting to PNG instead, which does support CICP). Alternatively you have to make a translator from CICP/NCLX codes to ICC yourself, which means pulling in a dependency on a color engine like LCMS2, or hard-code some common CICP->ICC combos into libheif. See also e.g. ImageMagick/ImageMagick#7308, ImageMagick/ImageMagick#6642 and ImageMagick/ImageMagick#7302 |
As far as Exif goes, I see no problem using v1.17.6 |
I was curiously following the discussion - Many thanks for the insights! @farindk If the tone mapping is out-of-scope for this project, please close this issue. |
For the library itself, this should not include any color management other than basic nclx handling. However, I would consider doing some (optional) color profile conversion in I'll leave this issue open. |
Could indeed be an option: keep the |
Hello all, I tried the demo (version 1.16.2) to convert a HIF file (10 bit) to JPG. The conversion went smoothly, however, I noticed two things : 1) No tone mapping has been applied (JPG image looks flat) and 2) All EXIF have been lost.
Is this an expected behaviour and is it still present in the newest release?
The text was updated successfully, but these errors were encountered: