Bug 282299
| Summary: | [HDR] Support HDR images | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Said Abou-Hallawa <sabouhallawa> |
| Component: | Images | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | bugzilla, greg323464, sabouhallawa, web, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Bug Depends on: | 295358, 280583, 282298, 282420, 282470, 283316, 287265, 287335, 287411, 287892, 287971, 287985, 288020, 288163, 288205, 288419, 288424, 288705, 288881, 289363, 289419, 289832, 289880, 290190, 290940, 291431, 291471, 291765, 292463, 292947, 295354 | ||
| Bug Blocks: | |||
Said Abou-Hallawa
This is an umbrella bug for the HDR support for images.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Said Abou-Hallawa
rdar://134397601
Said Abou-Hallawa
*** Bug 265796 has been marked as a duplicate of this bug. ***
Greg
Hi Said-
(replying per your comment on https://bugs.webkit.org/show_bug.cgi?id=265796 to use 282299 as the place to track HDR photo concerns)...
I have been unable to find any photos which properly renders as HDR under Safari Tech Preview Release 215 (Safari 18.4, WebKit 20622.1.6.111.4), with "Support HDR Display" enabled under Develop / Feature Flags on three different HDR monitors. I have heard several reports from others similarly reporting no HDR support. I have received one report (with confirming photo) of success with images from https://gregbenzphotography.com/hdr/#tests.
I've tried testing multiple different file formats and encodings and had no success. Is there a test case or scenario you should share? I haven't seen any description of which file encodings are intended to work under this new capability.
Is this currently only supported in WebKit and perhaps not yet in Safari Tech Preview 215?
Thank you,
Greg
Said Abou-Hallawa
Hello Greg,
Please make sure the experimental feature "Support HDR Display" is enabled in Safari. The feature may not work properly on older macOSs. And this is why we turned it off by default, see bug 290190. So please try to install macOS Sequoia if have not done so.
Currently we only support the HLG and PQ formats. You can test this on https://ccameron-chromium.github.io/hdr-jpeg/index.html.
The gain mapped images still do not show HDR contents; see bug 290940.
Thanks for trying this feature and please report any unexpected behavior with HDR images.
Said
Greg
Hi Said-
Thank you for the reference images.
Using Safari Tech Preview 215, "Support HDR Display" enabled, MacOS v15.3.2, and using ProDisplay XDR or M4 Max MBP, I see all images on https://ccameron-chromium.github.io/hdr-jpeg/index.html clipped to SDR.
That same URL looks great using Chrome, Brave, etc.
Regards,
Greg
Greg
Updating with experiences I see under the new tech preview 216.
The HLD-encoded JPG and AVIF images work at https://ccameron-chromium.github.io/hdr-jpeg/index.html
JXL HDR appears to work.
Use of the HDR range to render out of gamut SDR content is supported (Safari has been inconsistent in rendering test #14 across Safari on production MacOS vs iOS, and I consider the Tech Preview 216 behavior correct).
JPG (and JXL) gain maps still not supported under 216, consistent with your link to bug 290940 (https://bugs.webkit.org/show_bug.cgi?id=290940). Should be ok to close this bug and 290940 will track the open need for support of gain maps.
Great to see Safari supporting HDR photos!
Greg
Should Safari 216 be reporting 8-bit support when HDR works? Perhaps HDR is only supported under 8+2 FRC?
Test #5 shows 10-bit for Chrome, but not Safari 216: https://gregbenzphotography.com/hdr/#tests
Greg
Spoke a bit too soon here, 216 shows proper HDR but at a significantly lower headroom than Chrome.
I'm viewing images at https://gregbenzphotography.com/hdr/#tests
Greg
Hi Said-
Looks like 217 has regressed. I do not see HDR results on https://ccameron-chromium.github.io/hdr-jpeg/index.html with Safari Tech Preview 217. But 216 was HDR (though darker than what I see under Chrome). Tested with M4 MBP Max.
Regards,
Greg
Said Abou-Hallawa
Hi Greg,
We turned Support HDR Display off by default for now, see bug 290190. The system frameworks still have some glitches and we think it is better to enable it by default once everything is complete. You can turn it on from the Develop/Feature Flags dialog.
Thanks,
Said
Greg
Thank you, Said. Makes sense.
With Tech Preview 218 and enabling "Support HDR Display", I see support for simple HDR images.
I do not see support for gain maps (which is probably the expected result at this stage), at least for the various ISO encodings at https://gregbenzphotography.com/hdr/#tests
I see that bit depth reported via JavaScript reports 8 bits/channel. I would expect to see 10, but perhaps this is using 8-bit for HDR (or 8+2 FRC)? The CSS media query works as expected.
Greg
Safari 222 shows a significant regression. With "Support HDR Display" enabled, I see only failure. I have tried multiple image formats, web sites, and tests - and none show support for HDR photos.
Said Abou-Hallawa
Hello Greg,
Thanks for reporting this last report. I think you are trying the HDR on not 100% supported configuration. I think you are trying it on macOS Sequoia which has a limited support for HDR. I know HDR used to work on this configuration but maybe some code was introduced which will not even compile on macOS Sequoia. This code is guarded by `#if HAVE(SUPPORT_HDR_DISPLAY_APIS)`. Introducing this code broke HDR on your configuration. I will have a look. This should not be a problem once the feature is enabled by default.
Thanks,
Said
Greg
Hi Said-
Thank you for that feedback. I did test on MacOS 15.5. I just now installed the Safari Tech Preview on another device running Tahoe beta 2 and it shows HDR support.
With Safari TP 222 and regular Safari (both under Tahoe beta 2), I see the following bugs which were previously reported via Feedback Assistant remain open:
- bit depth (via JS) reported as 8 bits per channel on an HDR display instead of 10 (test #5)
- HDR AVIF gain map does not render properly (test #8c)
- Safari shows improperly rendered as SDR. This may involve the entire view port or just large horizontal blocks. Task switching seems to be a potential trigger.
For tests: https://gregbenzphotography.com/hdr/#tests
Said Abou-Hallawa
I filed bug 295358 and bug 295354. I resolved bug 295354 as MOVED because it is below WebKit and tracked by Apple internally as rdar://154351676.
isenberg
(In reply to Greg from comment #14)
> - Safari shows improperly rendered as SDR. This may involve the entire view
> port or just large horizontal blocks. Task switching seems to be a potential
> trigger.
In general my HDR gainmap JPEGs now work fine, great to see! However, when using the CSS features transform or position on images, they switch back to SDR. I filed bug 301398 now about that detail.