Posted by Alec Mouri – Software program Engineer
As defined in What’s HDR?, we are able to consider HDR as solely referring to a luminance vary brighter than SDR. When integrating HDR content material right into a person interface, you should be cautious when your person interface is primarily SDR colours and belongings. The human visible system adapts to perceived coloration primarily based on the encompassing surroundings, which might result in stunning outcomes. We’ll take a look at one pertinent instance.
Simultaneous Distinction
Take into account the next picture:

This picture reveals two grey rectangles with completely different background colours. For most individuals viewing this picture, the 2 grey rectangles seem like completely different shades of grey: the topmost rectangle with a darker background seems to be a lighter shade than the bottommost rectangle with a lighter background.
However these are the identical shades of grey! You’ll be able to show this to your self through the use of your favourite coloration choosing software or by trying on the under picture:

This illustrates a visible phenomenon known as simultaneous distinction. Readers who’re within the organic rationalization could be taught extra right here.
Close by variations in coloration are subsequently “emphasised”: colours seem darker when instantly subsequent to brighter colours. That very same coloration would seem lighter when instantly subsequent to darker colours.
Implications on Mixing HDR and SDR
The impact of simultaneous distinction impacts the looks of person interfaces that must current a mix of HDR and SDR content material. The height luminance allowed by HDR will create an impact of simultaneous distinction: the attention will adapt* to a better peak luminance (and oftentimes a better common luminance in apply), which can perceptually trigger SDR content material to look dimmer though technically the SDR content material luminance has not modified in any respect. For customers, this may be expressed as: my cellphone display grew to become “gray” or “washed out”.
We are able to see this phenomenon within the under picture. The gadget on the appropriate simulates how images could seem with an SDR UI, if these images have been rendered as HDR. Be aware that the August images look similar compared side-by-side, however the high quality of the SDR UI is visually degraded.

Functions, when designing for HDR, want to contemplate how “a lot” SDR is proven at any given time of their screens when controlling how vivid HDR is “allowed” to be. A UI that’s dominated by SDR, reminiscent of a gallery view the place small quantities of HDR content material are displayed, can all of a sudden seem like darker than anticipated.
When constructing your UI, think about the affect of HDR on textual content legibility or the looks of close by SDR belongings, and use the suitable APIs offered by your platform to constrain HDR brightness, and even disable HDR. For instance, a 2x headroom for HDR brightness could also be acceptable to steadiness the standard of your HDR scene together with your SDR parts. In distinction, a UI that’s dominated by HDR, reminiscent of full-screen video with out different UI parts on-top, doesn’t want to contemplate this as strongly, as the main target of the UI is on the HDR content material itself. In these conditions, a 5x headroom (or larger, relying on content material metadata reminiscent of UltraHDR‘s max_content_boost) could also be extra acceptable.
It could be tempting to “brighten” SDR content material as an alternative. Resist this temptation! It will trigger your utility to be too vivid, particularly if there are different purposes or system UI parts on-screen.
The best way to management HDR headroom
Android 15 launched a management for desired HDR headroom. You’ll be able to have your utility request that the system makes use of a selected HDR headroom primarily based on the context round your required UI:
- If you happen to solely wish to present SDR content material, merely request no headroom.
- If you happen to solely wish to present HDR content material, then request a excessive HDR headroom as much as and in accordance with the calls for of the content material.
- If you wish to present a mix of HDR and SDR content material, then can request an intermediate headroom worth accordingly. Typical headroom quantities can be round 2x for a combined scene and 5-8x for a fully-HDR scene.
Right here is a few instance utilization:
// Required for the window to respect the specified HDR headroom. // Be aware that the equal api on SurfaceView does NOT require // COLOR_MODE_HDR to constraint headroom, if there's HDR content material displayed // on the SurfaceView. window.colorMode = ActivityInfo.COLOR_MODE_HDR // Illustrative values: completely different headroom values could also be used relying on // the specified headroom of the content material AND particularities of apps's UI // design. window.desiredHdrHeadroom = if(/* SDR solely */) { 0f } else { if (/* Blended, principally SDR */) { 1.5f } else { if ( /* Blended, principally HDR */) { 3f } else { /* HDR solely */ 5f } } }
Different platforms even have APIs that permit for builders to have some management over constraining HDR content material of their utility.
Internet platforms have a extra coarse idea: The First Public Working Draft of the CSS Colour HDR Module provides a constrained-high choice to constrain the headroom for combined HDR and SDR scenes. Throughout the Apple ecosystem, constrainedHigh is equally coarse, reckoning with the challenges of displaying combined HDR and SDR scenes on client shows.
If you’re a developer who’s contemplating supporting HDR, be considerate about how HDR interacts together with your UI and use HDR headroom controls appropriately.
*There are different mechanisms the attention employs for gentle adaptation, like pupillary gentle reflex, which amplifies this visible phenomenon (brighter peak HDR gentle means the pupil constricts, which causes much less gentle to hit the retina).