{"id":347979,"date":"2025-09-10T15:49:49","date_gmt":"2025-09-10T20:49:49","guid":{"rendered":"https:\/\/michigandigitalnews.com\/index.php\/2025\/09\/10\/android-developers-blog-hdr-and-user-interfaces\/"},"modified":"2025-09-10T15:49:49","modified_gmt":"2025-09-10T20:49:49","slug":"android-developers-blog-hdr-and-user-interfaces","status":"publish","type":"post","link":"https:\/\/michigandigitalnews.com\/index.php\/2025\/09\/10\/android-developers-blog-hdr-and-user-interfaces\/","title":{"rendered":"Android Developers Blog: HDR and User Interfaces"},"content":{"rendered":"<p> [ad_1]<br \/>\n<\/p>\n<div>\n<meta name=\"twitter:image\" content=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEhpZI5YY5Oj833Cvxt21-E54SjcylXmmumqvkQ9FIPWn3LqeiAjkaZyhsSRmOz_FWnKyRmD7xyPwf_Qg9hD8n_89VvgATa5vsTLzSVEPyc78XX8MkA3eeBKPbTt7jnIJSybCrscAppOTKGvP9wC_qnKf_4EOTZI2L4tY6VtUmz3yNyb66_6QQQr1sHU924\/s1600\/HDR-user-interfaces.png\"\/><br \/>\n<img decoding=\"async\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEhpZI5YY5Oj833Cvxt21-E54SjcylXmmumqvkQ9FIPWn3LqeiAjkaZyhsSRmOz_FWnKyRmD7xyPwf_Qg9hD8n_89VvgATa5vsTLzSVEPyc78XX8MkA3eeBKPbTt7jnIJSybCrscAppOTKGvP9wC_qnKf_4EOTZI2L4tY6VtUmz3yNyb66_6QQQr1sHU924\/s1600\/HDR-user-interfaces.png\" style=\"display:none\"\/><\/p>\n<p><em>Posted by Alec Mouri &#8211; Software Engineer<\/em><\/p>\n<p><a href=\"http:\/\/android-developers.googleblog.com\/2025\/09\/IMG\" imageanchor=\"1\"><img decoding=\"async\" border=\"0\" data-original-height=\"800\" data-original-width=\"100%\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEj8yzoBsDjctmg59xu56At8rF-hngncE92f6Dsk-9_3-wXZVtyO5XrCMvZ5VfchsDjY0n0SqJqgRWBXB355jgjQM8cNBet07JQYPmcFq4WtvllfjdyflCJD5vGp_oB1sSk6QKATzPnUW8GZ_ai3vfDlnUzwAa7_NlzFqX8VY_reaunuLOPnZypDWwFkWTs\/s1600\/Android_Evergreen_Hero_Banner_Cloud_Development.png\" style=\"100%\"\/><\/a><\/p>\n<p>As explained in <a href=\"https:\/\/android-developers.googleblog.com\/2025\/08\/what-is-hdr.html\" target=\"_blank\" rel=\"noopener\">What is HDR?<\/a>, we can think of HDR as only referring to a luminance range brighter than SDR. When integrating HDR content into a user interface, you must be careful when your user interface is primarily SDR colors and assets. The human visual system adapts to perceived color based on the surrounding environment, which can lead to surprising results. We\u2019ll look at one pertinent example.<\/p>\n<h2><span style=\"font-size: x-large;\">Simultaneous Contrast<\/span><\/h2>\n<p>Consider the following image:<\/p>\n<p><image><\/p>\n<div style=\"text-align: center;\"><img decoding=\"async\" alt=\"contrast example 1\" border=\"0\" id=\"imgCaption\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEgsBqZ0NFKfWOfSGBeNQM1a1XljGEub9c2Vau2RtSqBeKkvv6FzwAxhnuR7PbI18zHyZBlxqjPOzU_OMMzH-noaCbiXFUjrWmMqwuSJexS216-UNdk3ZMkDF3iZ53-xSWEMJlYBNzT3XRL0Xpbw9JbIGxpsDLBbm2SZT_C0ZpcfijA-eF2XXrkSZARxV70\/s1600\/image3.png\" width=\"50%\"\/><\/div>\n<p><imgcaption><center><em>Source: <a href=\"https:\/\/en.wikipedia.org\/wiki\/Contrast_effect#\/media\/File:Simultaneous_Contrast.svg\" target=\"_blank\" rel=\"noopener\">Wikipedia<\/a><\/em><\/center><\/imgcaption><\/image><\/p>\n<p>This image shows two gray rectangles with different background colors. For most people viewing this image, the two gray rectangles appear to be different shades of gray: the topmost rectangle with a darker background appears to be a lighter shade than the bottommost rectangle with a lighter background.<\/p>\n<p>But these are the same shades of gray! You can prove this to yourself by using your favorite color picking tool or by looking at the below image:<\/p>\n<p><image><\/p>\n<div style=\"text-align: center;\"><img decoding=\"async\" alt=\"contrast example 2\" border=\"0\" id=\"imgCaption\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEg4Ipl6C_6jl7FU-jxKN7eGsAp3oF3ek9Mc-9VX8BxmPWyMEOO14xb_Q7pQ4V7nTmP6ryfaNt5s5LVPifHLPXVL5r8QFs8kXLGJ720znKPzD7rFS7-kSvAwq81H-MRcoKBOu4_9lW9Y039VHFtlOepv3m2BWw41OCP5_jCE32A3XS3MVDFa4_sodj6u_HM\/s1600\/image4.png\" width=\"50%\"\/><\/div>\n<p><\/image><\/p>\n<p>This illustrates a visual phenomenon called simultaneous contrast. Readers who are interested in the biological explanation may learn more <a href=\"https:\/\/www.cns.nyu.edu\/~david\/courses\/perception\/lecturenotes\/brightness-contrast\/brightness-contrast.html\" target=\"_blank\" rel=\"noopener\">here<\/a>.<\/p>\n<p>Nearby differences in color are therefore \u201cemphasized\u201d: colors appear darker when immediately next to brighter colors. That same color would appear lighter when immediately next to darker colors.<\/p>\n<h2><span style=\"font-size: x-large;\">Implications on Mixing HDR and SDR<\/span><\/h2>\n<p>The effect of simultaneous contrast affects the appearance of user interfaces that need to present a mixture of HDR and SDR content. The peak luminance allowed by HDR will create an effect of simultaneous contrast: the eye will adapt<b>*<\/b> to a higher peak luminance (and oftentimes a higher average luminance in practice), which will perceptually cause SDR content to appear dimmer although technically the SDR content luminance has not changed at all. For users, this can be expressed as: my phone screen became \u201cgrey\u201d or \u201cwashed out\u201d.<\/p>\n<p>We can see this phenomenon in the below image. The device on the right simulates how photos may appear with an SDR UI, if those photos were rendered as HDR. Note that the August photos look identical when compared side-by-side, but the quality of the SDR UI is visually degraded.<\/p>\n<p><image><\/p>\n<div style=\"text-align: center;\"><img decoding=\"async\" alt=\"contrast example on Google Photos\" border=\"0\" id=\"imgCaption\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEgjA2y-wJh6SAM6flTRk9mgko61OXHQB3hz9n-uGipPyUBywQzKK7XN774vkVXk7GC4YDrkSHl3K27CXqXO6mYiZlBKEsNkoMFWPimx917WimZ5cnCHl60_oa0JyztloyV4az9k6Eb__n3Ggr9ocSlZEtEPjhgHN0b_9GbC_MaQrdVk7PGm30ngazHbFMs\/s1600\/HDR-user-interfaces.png\" width=\"80%\"\/><\/div>\n<p><\/image><\/p>\n<p>Applications, when designing for HDR, need to consider how \u201cmuch\u201d SDR is shown at any given time in their screens when controlling how bright HDR is \u201callowed\u201d to be. A UI that is dominated by SDR, such as a gallery view where small amounts of HDR content are displayed, can suddenly appear to be darker than expected.<\/p>\n<p>When building your UI, consider the impact of HDR on text legibility or the appearance of nearby SDR assets, and use the appropriate APIs provided by your platform to constrain HDR brightness, or even disable HDR. For example, a 2x headroom for HDR brightness may be acceptable to balance the quality of your HDR scene with your SDR elements. In contrast, a UI that is dominated by HDR, such as full-screen video without other UI elements on-top, does not need to consider this as strongly, as the focus of the UI is on the HDR content itself. In those situations, a 5x headroom (or higher, depending on content metadata such as <a href=\"https:\/\/developer.android.com\/media\/platform\/hdr-image-format\" target=\"_blank\" rel=\"noopener\">UltraHDR<\/a>&#8216;s max_content_boost) may be more appropriate.<\/p>\n<p>It might be tempting to \u201cbrighten\u201d SDR content instead. Resist this temptation! This will cause your application to be <b>too<\/b> bright, especially if there are other applications or system UI elements on-screen. <\/p>\n<h2><span style=\"font-size: x-large;\">How to control HDR headroom<\/span><\/h2>\n<p>Android 15 introduced a control for <a href=\"https:\/\/developer.android.com\/about\/versions\/15\/features#hdr-headroom\" target=\"_blank\" rel=\"noopener\">desired HDR headroom<\/a>. You can have your application request that the system uses a particular HDR headroom based on the context around your desired UI:<\/p>\n<ul>\n<ul>\n<li>If you only want to show SDR content, simply request no headroom.<\/li>\n<li>If you only want to show HDR content, then request a high HDR headroom up to and according to the demands of the content.<\/li>\n<li>If you want to show a mixture of HDR and SDR content, then can request an intermediate headroom value accordingly. Typical headroom amounts would be around 2x for a mixed scene and 5-8x for a fully-HDR scene.<\/li>\n<\/ul>\n<\/ul>\n<p>Here is some example usage:<\/p>\n<p><!--Kotlin--><\/p>\n<div style=\"background: #f8f8f8; overflow:auto;width:auto;border:0;\">\n<pre style=\"margin: 0; line-height: 125%;\"><span\/><span style=\"color: #3D7B7B; font-style: italic\">\/\/ Required for the window to respect the desired HDR headroom.<\/span>\n<span style=\"color: #3D7B7B; font-style: italic\">\/\/ Note that the equivalent api on SurfaceView does NOT require<\/span>\n<span style=\"color: #3D7B7B; font-style: italic\">\/\/ COLOR_MODE_HDR to constraint headroom, if there is HDR content displayed<\/span>\n<span style=\"color: #3D7B7B; font-style: italic\">\/\/ on the SurfaceView.<\/span>\nwindow.<span style=\"color: #687822\">colorMode<\/span><span style=\"color: #BBB\"> <\/span><span style=\"color: #666\">=<\/span><span style=\"color: #BBB\"> <\/span>ActivityInfo.<span style=\"color: #687822\">COLOR_MODE_HDR<\/span>\n<span style=\"color: #3D7B7B; font-style: italic\">\/\/ Illustrative values: different headroom values may be used depending on<\/span>\n<span style=\"color: #3D7B7B; font-style: italic\">\/\/ the desired headroom of the content AND particularities of apps's UI<\/span>\n<span style=\"color: #3D7B7B; font-style: italic\">\/\/ design.<\/span>\nwindow.<span style=\"color: #687822\">desiredHdrHeadroom<\/span><span style=\"color: #BBB\"> <\/span><span style=\"color: #666\">=<\/span>\n<span style=\"color: #BBB\">    <\/span><span style=\"color: #008000; font-weight: bold\">if<\/span>(<span style=\"color: #3D7B7B; font-style: italic\">\/* SDR only *\/<\/span>)<span style=\"color: #BBB\"> <\/span>{\n<span style=\"color: #BBB\">        <\/span><span style=\"color: #666\">0f<\/span>\n<span style=\"color: #BBB\">    <\/span>}<span style=\"color: #BBB\"> <\/span><span style=\"color: #008000; font-weight: bold\">else<\/span><span style=\"color: #BBB\"> <\/span>{\n<span style=\"color: #BBB\">        <\/span><span style=\"color: #008000; font-weight: bold\">if<\/span><span style=\"color: #BBB\"> <\/span>(<span style=\"color: #3D7B7B; font-style: italic\">\/* Mixed, mostly SDR *\/<\/span>)<span style=\"color: #BBB\"> <\/span>{\n<span style=\"color: #BBB\">            <\/span><span style=\"color: #666\">1.5f<\/span>\n<span style=\"color: #BBB\">        <\/span>}<span style=\"color: #BBB\"> <\/span><span style=\"color: #008000; font-weight: bold\">else<\/span><span style=\"color: #BBB\"> <\/span>{\n<span style=\"color: #BBB\">            <\/span><span style=\"color: #008000; font-weight: bold\">if<\/span><span style=\"color: #BBB\"> <\/span>(<span style=\"color: #BBB\"> <\/span><span style=\"color: #3D7B7B; font-style: italic\">\/* Mixed, mostly HDR *\/<\/span>)<span style=\"color: #BBB\"> <\/span>{\n<span style=\"color: #BBB\">                <\/span><span style=\"color: #666\">3f<\/span>\n<span style=\"color: #BBB\">            <\/span>}<span style=\"color: #BBB\"> <\/span><span style=\"color: #008000; font-weight: bold\">else<\/span><span style=\"color: #BBB\"> <\/span>{<span style=\"color: #BBB\"> <\/span>\n<span style=\"color: #BBB\">                <\/span><span style=\"color: #3D7B7B; font-style: italic\">\/* HDR only *\/<\/span>\n<span style=\"color: #BBB\">                <\/span><span style=\"color: #666\">5f<\/span>\n<span style=\"color: #BBB\">            <\/span>}\n<span style=\"color: #BBB\">        <\/span>}\n<span style=\"color: #BBB\">    <\/span>}\n<\/pre>\n<\/div>\n<p>Other platforms also have APIs that allow for developers to have some control over constraining HDR content in their application.<\/p>\n<p>Web platforms have a more coarse concept: The First Public Working Draft of the CSS Color HDR Module adds a <a href=\"https:\/\/www.w3.org\/TR\/css-color-hdr-1\/#the-dynamic-range-limit-property\" target=\"_blank\" rel=\"noopener\">constrained-high<\/a> option to constrain the headroom for mixed HDR and SDR scenes. Within the Apple ecosystem, <a href=\"https:\/\/developer.apple.com\/documentation\/swiftui\/image\/dynamicrange\/constrainedhigh\" target=\"_blank\" rel=\"noopener\">constrainedHigh<\/a> is similarly coarse, reckoning with the challenges of displaying mixed HDR and SDR scenes on consumer displays.<\/p>\n<p>If you are a developer who is considering supporting HDR, be thoughtful about how HDR interacts with your UI and use HDR headroom controls appropriately.<\/p>\n<hr\/>\n<p>*<em>There are other mechanisms the eye employs for light adaptation, like pupillary light reflex, which amplifies this visual phenomenon (brighter peak HDR light means the pupil constricts, which causes less light to hit the retina).<\/em><\/p>\n<\/div>\n<p>[ad_2]<br \/>\n<br \/><a href=\"http:\/\/android-developers.googleblog.com\/2025\/09\/hdr-and-user-interfaces.html\">Source link <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>[ad_1] Posted by Alec Mouri &#8211; Software Engineer As explained in What is HDR?, we can think of HDR as only referring to a luminance<\/p>\n","protected":false},"author":1,"featured_media":347980,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[146],"tags":[],"_links":{"self":[{"href":"https:\/\/michigandigitalnews.com\/index.php\/wp-json\/wp\/v2\/posts\/347979"}],"collection":[{"href":"https:\/\/michigandigitalnews.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/michigandigitalnews.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/michigandigitalnews.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/michigandigitalnews.com\/index.php\/wp-json\/wp\/v2\/comments?post=347979"}],"version-history":[{"count":0,"href":"https:\/\/michigandigitalnews.com\/index.php\/wp-json\/wp\/v2\/posts\/347979\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/michigandigitalnews.com\/index.php\/wp-json\/wp\/v2\/media\/347980"}],"wp:attachment":[{"href":"https:\/\/michigandigitalnews.com\/index.php\/wp-json\/wp\/v2\/media?parent=347979"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michigandigitalnews.com\/index.php\/wp-json\/wp\/v2\/categories?post=347979"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michigandigitalnews.com\/index.php\/wp-json\/wp\/v2\/tags?post=347979"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}