<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>282299</bug_id>
          
          <creation_ts>2024-10-29 16:29:16 -0700</creation_ts>
          <short_desc>[HDR] Support HDR images</short_desc>
          <delta_ts>2026-01-13 11:24:41 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Images</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>295358</dependson>
    
    <dependson>280583</dependson>
    
    <dependson>282298</dependson>
    
    <dependson>282420</dependson>
    
    <dependson>282470</dependson>
    
    <dependson>283316</dependson>
    
    <dependson>287265</dependson>
    
    <dependson>287335</dependson>
    
    <dependson>287411</dependson>
    
    <dependson>287892</dependson>
    
    <dependson>287971</dependson>
    
    <dependson>287985</dependson>
    
    <dependson>288020</dependson>
    
    <dependson>288163</dependson>
    
    <dependson>288205</dependson>
    
    <dependson>288419</dependson>
    
    <dependson>288424</dependson>
    
    <dependson>288705</dependson>
    
    <dependson>288881</dependson>
    
    <dependson>289363</dependson>
    
    <dependson>289419</dependson>
    
    <dependson>289832</dependson>
    
    <dependson>289880</dependson>
    
    <dependson>290190</dependson>
    
    <dependson>290940</dependson>
    
    <dependson>291431</dependson>
    
    <dependson>291471</dependson>
    
    <dependson>291765</dependson>
    
    <dependson>292463</dependson>
    
    <dependson>292947</dependson>
    
    <dependson>295354</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Said Abou-Hallawa">sabouhallawa</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bugzilla</cc>
    
    <cc>greg323464</cc>
    
    <cc>sabouhallawa</cc>
    
    <cc>web</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2071450</commentid>
    <comment_count>0</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2024-10-29 16:29:16 -0700</bug_when>
    <thetext>This is an umbrella bug for the HDR support for images.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2071452</commentid>
    <comment_count>1</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2024-10-29 16:30:00 -0700</bug_when>
    <thetext>rdar://134397601</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2107010</commentid>
    <comment_count>2</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2025-03-28 17:36:51 -0700</bug_when>
    <thetext>*** Bug 265796 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2107021</commentid>
    <comment_count>3</comment_count>
    <who name="Greg">greg323464</who>
    <bug_when>2025-03-28 18:23:25 -0700</bug_when>
    <thetext>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 &quot;Support HDR Display&quot; 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&apos;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&apos;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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2108277</commentid>
    <comment_count>4</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2025-04-02 13:25:27 -0700</bug_when>
    <thetext>Hello Greg,

Please make sure the experimental feature &quot;Support HDR Display&quot; 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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2108286</commentid>
    <comment_count>5</comment_count>
    <who name="Greg">greg323464</who>
    <bug_when>2025-04-02 13:36:32 -0700</bug_when>
    <thetext>Hi Said- 

Thank you for the reference images.

Using Safari Tech Preview 215, &quot;Support HDR Display&quot; 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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2108867</commentid>
    <comment_count>6</comment_count>
    <who name="Greg">greg323464</who>
    <bug_when>2025-04-04 06:44:45 -0700</bug_when>
    <thetext>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!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2108871</commentid>
    <comment_count>7</comment_count>
    <who name="Greg">greg323464</who>
    <bug_when>2025-04-04 07:16:53 -0700</bug_when>
    <thetext>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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2109005</commentid>
    <comment_count>8</comment_count>
    <who name="Greg">greg323464</who>
    <bug_when>2025-04-04 15:13:03 -0700</bug_when>
    <thetext>Spoke a bit too soon here, 216 shows proper HDR but at a significantly lower headroom than Chrome. 
I&apos;m viewing images at https://gregbenzphotography.com/hdr/#tests</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2111678</commentid>
    <comment_count>9</comment_count>
    <who name="Greg">greg323464</who>
    <bug_when>2025-04-17 15:30:05 -0700</bug_when>
    <thetext>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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2111876</commentid>
    <comment_count>10</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2025-04-18 12:28:42 -0700</bug_when>
    <thetext>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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2114356</commentid>
    <comment_count>11</comment_count>
    <who name="Greg">greg323464</who>
    <bug_when>2025-04-30 20:00:14 -0700</bug_when>
    <thetext>Thank you, Said. Makes sense.

With Tech Preview 218 and enabling &quot;Support HDR Display&quot;, 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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2127285</commentid>
    <comment_count>12</comment_count>
    <who name="Greg">greg323464</who>
    <bug_when>2025-07-02 06:48:26 -0700</bug_when>
    <thetext>Safari 222 shows a significant regression. With &quot;Support HDR Display&quot; enabled, I see only failure. I have tried multiple image formats, web sites, and tests - and none show support for HDR photos.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2127321</commentid>
    <comment_count>13</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2025-07-02 10:16:03 -0700</bug_when>
    <thetext>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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2127339</commentid>
    <comment_count>14</comment_count>
    <who name="Greg">greg323464</who>
    <bug_when>2025-07-02 11:07:12 -0700</bug_when>
    <thetext>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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2127397</commentid>
    <comment_count>15</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2025-07-02 14:19:36 -0700</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2153919</commentid>
    <comment_count>16</comment_count>
    <who name="isenberg">web</who>
    <bug_when>2025-10-23 21:32:13 -0700</bug_when>
    <thetext>(In reply to Greg from comment #14)
&gt; - Safari shows improperly rendered as SDR. This may involve the entire view
&gt; port or just large horizontal blocks. Task switching seems to be a potential
&gt; 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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2171328</commentid>
    <comment_count>17</comment_count>
    <who name="isenberg">web</who>
    <bug_when>2026-01-12 20:27:18 -0800</bug_when>
    <thetext>Works fine now also with CSS transform features on Safari 26.2 public release on macOS 26.2 and iOS 26.2!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2171433</commentid>
    <comment_count>18</comment_count>
    <who name="Greg">greg323464</who>
    <bug_when>2026-01-13 07:50:18 -0800</bug_when>
    <thetext>CSS transitions still force HDR to show as SDR while the transition is active. Can see an example by mousing over the image grid vs edges of this page: https://gregbenzphotography.com/hdr-gain-map-gallery/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2171501</commentid>
    <comment_count>19</comment_count>
    <who name="isenberg">web</who>
    <bug_when>2026-01-13 11:07:26 -0800</bug_when>
    <thetext>(In reply to Greg from comment #18)
&gt; CSS transitions 

Those I&apos;m not using, only attributes position and transform. Do you have filed a separate bug for those already?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2171510</commentid>
    <comment_count>20</comment_count>
    <who name="Greg">greg323464</who>
    <bug_when>2026-01-13 11:24:41 -0800</bug_when>
    <thetext>Previous reported via Feedback Assistant, but just created a new bug for the transitions issue: https://bugs.webkit.org/show_bug.cgi?id=305407</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>