In particular for HDR, it would be great if Open Camera could have an option to save a photo as an actual HDR JPEG XL image, as opposed to applying tonemapping to get a nice SDR image.
More info on JPEG XL: https://jpegxl.info/why-jxl.html
The easiest way to implement this would be to integrate libjxl (https://github.com/libjxl/libjxl), which is already well-optimized for ARM.
Anonymous
I would also love to see JXL being supported
+1
What's slowing down the adoption of JXL in android is the lack of camera and gallery apps supporting it. JXL may save great amount of storage space for OpenCamera images
Any update on this?
(I'm a different person than the Anonymous above, fyi.)
Google seem to be preferring UltraHDR ( https://developer.android.com/media/platform/hdr-image-format ) for now.
Not sure about that, Mark. Google just decided to sponsor a decoder for Jpeg-XL for Firefox:
https://github.com/mozilla/standards-positions/pull/1064
Sorry should have logged in first, before commenting. :)
Ah sorry, I meant in terms of what they're supporting in Android and in terms of Android APIs. There's support for getting UltraHDR images direct from the camera, as well as saving UltraHDR images. Not that I'm supporting that either yet, but the built-in Android support makes it easier.
There is a feature request for supporting JPEG XL in Android: https://issuetracker.google.com/issues/259900694
I would love to see this.
JPG is subpar, PNG is basically JPG anyway. WEBP is not a image format (it's webm).
JPEG XL woud be a great fit here.
Still yet to see anything?
I would also love to see this, but realistically, this will take considerable time given that Open Camera has very limited manpower and relies on built-in Android software as much as possible. The request for Android to support JXL is 2 years old with no solution in sight, and JXL support in Chromium was requested in February 2021, also without a solution in the short-term.
I doubt that Google will support JXL using libjxl, which is an immature C++ library, and I doubt that Open Camera will support JXL without Android support.
I implemented JPEG XL inside the OpenCamera source code: https://github.com/nicolas-raoul/OpenCamera-JPEG-XL

Using Apache 2 library https://github.com/awxkee/jxl-coder.
It does the job for me on a Pixel 5.
I added two variants as you can see on the screenshot below.
Feedback welcome!
Thank you very much @Nicolas! Waiting for this for a while!
Do you think it would be much effort to also add AVIF (images) #963
and/or AV1 (video) #1215 support?
Especially in this case it should be possible without additional dependencies. As far I understand there are Android SDK/API capabilities for these formats.
(Might be possible to only offer as selectable option on newer Android versions/hardware though)
Sure, I just added AVIF support, though via https://github.com/awxkee/avif-coder.
Would you have more info on an Android SDK/API for AVIF?
One class I found on the quick:
https://developer.android.com/reference/androidx/heifwriter/AvifWriter
Note that Dolby have reportedly sued Snap over AV1 (e.g. https://www.techspot.com/news/111865-dolby-sues-snap-over-video-compression-patent-claims.html ). It's possible that applies more to applications including that code specifically rather than using on-device codecs (AV1 at least has Android support directly now as far as I can tell). But then, more generally, that does highlight a risk of including third party libraries to do image/video encoding (in theory the risk applies to any code I write - but encoding/codecs arguably seem to be things more likely to attract patent claims).
I also need to think how this works with UltraHDR - ideally any new formats (JPEG XL, HEIC, Avif) should support UltraHDR in which case maybe I need to break that out into a separate option.