Hdr metadata in image
This implements #106 (closed)
This implements three optional in KisImage, together with an applicator to calculate the maxcll and maxfall. It also saves and loads this to a kra file. These optionals are used to inform the gamut and tone mapping calculations when exported to a HDR10 format.
The end goal is to replace VideoHDRMetadataOptionsDialog in the ffmpeg settings, as well as setup this data for png and heif/avif and any other place we can use this data.
Todo:
- Implement the three HDR elements in KisImage, and give them ui in Image properties
- Save and Load to Kra files.
- Fix KisContentLightLevelProcessingVistor to work on frames somehow.
- Replace VideoHDRMetadataOptionsDialog with this data (tricky)
- blocked by BUG:520669
- works with ffmpeg 6
-
Load this data from imported video.- Not possible: HDR metadata is codec specific, so ffprobe won't list it.
-
Plug data into wayland API somehow ?- Too complex for this MR.
- Load from heif/avif (Untested...)
- Saving requires patching libheif, because we need access via the cxx.h api.
- Implement export check.
Test Plan
- Load HDR image.
- Go to image->properties->HDR metadata
- Play with the toggles.
- Save kra file
- Load kra file
- Save HDR animation with FFMPEG 6.0, the hdr data will be pulled from the image properties.
- Test saving non-kra file; there should be a warning about HDR metadata.
Formalities Checklist
- I confirmed this builds.
- I confirmed Krita ran and the relevant functions work.
-
I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!) - I made sure my commits build individually and have good descriptions as per KDE guidelines.
- I made sure my code conforms to the standards set in the HACKING file.
- I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.
- Does the patch add a user-visible feature? If yes, is there a documentation MR ready for it at Krita Documentation Repository?
- There's a branch waiting, might be used for other HDR documentation.
Edited by Wolthera van Hövell