Gallery icon indicating copy to clipboard operation
Gallery copied to clipboard

[Enhancement] Add ultra HDR support

Open CeruleanDerpo opened this issue 1 year ago • 17 comments

Is your feature request related to a problem? Please describe. Most modern phones (such as pixel phones) add extra data to photos to control the brightness of the screen in each pixel of the image, this is called Ultra HDR. If you take a photo on the default camera app, it will look brighter on other apps such as Google Photos compared to Gallery.

Describe the solution you'd like Implement gain map detection and display for photos, it is explained here

Additional context Not really possible to screenshot since it just controls screen brightness, some ultra HDR examples are on this page

Note that ultra HDR is only supported starting from android 14

CeruleanDerpo avatar Oct 02 '24 09:10 CeruleanDerpo

On the topic, ISO 21496-1 should be supported as well. Android 15 and iOS 18 have both adopted it for cross platform HDR jpegs. On Android the Adobe derived standard currently powering ultra HDR will live on for a while side by side with ISO 21496-1 method.

https://www.androidauthority.com/google-apple-hdr-photo-standard-3495035/

locuturus avatar Oct 29 '24 20:10 locuturus

Greetings. I installed 3.0.1-30131 Release version and there's something wrong with HDR photos. The screen brightness is increased only once for each photo. Then these photos will always look like regular SDR photos. Pixel 8 Pro, Android 15.

gsdgethjfjj avatar Nov 09 '24 11:11 gsdgethjfjj

Greetings. I installed 3.0.1-30131 Release version and there's something wrong with HDR photos. The screen brightness is increased only once for each photo. Then these photos will always look like regular SDR photos. Pixel 8 Pro, Android 15.

I don't have a HDR compatible device so can you explain a bit better when the photos are brightening correctly, when they aren't, when they should be

IacobIonut01 avatar Nov 09 '24 13:11 IacobIonut01

Yeah sure.

So when I open the gallery I see a bunch of photos. No HDR brightness there and probably shouldn't be, at least this behavior is the same as in Google Photos, I see regular SDR miniatures.

Then I click at one of these miniatures to open some HDR photo. What I expect here and what should always happen is the photo will open up in HDR mode with fancy colors and high brightness. However for some reason it works only one time for one photo. After I close the app and then open the same HDR photo as before, it will look like a regular SDR photo without proper colors and high brightness. This photo is cursed now and I won't see HDRness at this photo in your app. Sometimes I don't even need to close the app to downgrade the photo and swiping between different photos is enough. Swiping though doesn't always work and I couldn't find any pattern. Closing the app will break the photo 100% of time.

Photo itself didn't change as I can see it without issues in Google Photos.

Hope this helps.

gsdgethjfjj avatar Nov 09 '24 19:11 gsdgethjfjj

Ok great, I'll release tomorrow a fix for it, thanks

IacobIonut01 avatar Nov 09 '24 19:11 IacobIonut01

Hello again, I saw you closed the issue.

I downloaded latest nightly and this problem still there. Then I tried apk from https://github.com/IacobIonut01/Gallery/actions/runs/11768163534 just in case and result was the same.

gsdgethjfjj avatar Nov 11 '24 21:11 gsdgethjfjj

Is the issue actually the same? I can't really test it, just with logging I can see that when a bitmap has gainmap the color space is set and removed when the next page is in place and the image does not not have gainmap

IacobIonut01 avatar Nov 11 '24 21:11 IacobIonut01

Well I don't know what bitmap and gainmap is but yeah the issue is the same. Once one photo is viewed it becomes "cursed" and no high brightness and saturated colors will be there for this photo.

gsdgethjfjj avatar Nov 11 '24 21:11 gsdgethjfjj

Well I don't know what bitmap and gainmap is but yeah the issue is the same. Once one photo is viewed it becomes "cursed" and no high brightness and saturated colors will be there for this photo.

I'll try to find someway to test it properly; gainmap is the HDR light map applied over normal photos that the display can show to properly view the photos

IacobIonut01 avatar Nov 11 '24 21:11 IacobIonut01

Great, let me know if I can help you somehow

gsdgethjfjj avatar Nov 11 '24 21:11 gsdgethjfjj

I'm using a Pixel 7 Pro and can confirm that the Ultra HDR mode works, but it's very unreliable. Sometimes it will show for an image, sometimes it won't.

I volunteer for testing as I have the required hardware available and I'm very interested in this feature.

Another thing I noticed about the HDR support are those random dark lines that appear on images being rendered with the correct gainmap. They can be horizontal, or vertical, or not show at all seemingly at random. The also change and fade on zooming. Another odd thing about them is, that they even show up on screenshots

Image

And then, after zooming:

Image

If I find the time, I'm going to dig around the code and do some testing, maybe I can get it fixed. 😄

Thanks for the great work on this app, I'm really digging it! 💪🏻

Manut38 avatar Jan 21 '25 16:01 Manut38

Oh those lines are actually how subsampling works, I find it weird that would show up in HDR mode, even weirder that they are visible in the screenshots as well

IacobIonut01 avatar Jan 21 '25 17:01 IacobIonut01

@IacobIonut01 yeah I found that very strange indeed... Forgot to mention that I was able to recreate this on the current 3.1.1-31118 nightly build.

Manut38 avatar Jan 21 '25 17:01 Manut38

oh this is funny they show up on Google photos as well

Image

CeruleanDerpo avatar Feb 28 '25 15:02 CeruleanDerpo

I've also found this online: https://support.google.com/pixelphone/thread/312390964/black-lines-on-photo-when-zoomed-in?hl=en

So the issue might not be specific to the gallery app

CeruleanDerpo avatar Mar 05 '25 11:03 CeruleanDerpo

I've also found this online: https://support.google.com/pixelphone/thread/312390964/black-lines-on-photo-when-zoomed-in?hl=en

So the issue might not be specific to the gallery app

Fun

IacobIonut01 avatar Mar 05 '25 13:03 IacobIonut01

So the issue might not be specific to the gallery app

It is true that it happens in Google Photos as well, but it happens much more often in Gallery.

lantw44 avatar Mar 05 '25 13:03 lantw44

I'm experiencing the issue as well on a Pixel 8a with the v3.1.2 (312094) on Android 15

raphaelyancey avatar May 12 '25 16:05 raphaelyancey

I haven't seen any issues so far on 4.0.0 with P10 Pro

IacobIonut01 avatar Oct 11 '25 11:10 IacobIonut01