
Posted by Alec Mouri – Software program Engineer
As defined in What’s HDR?, we will 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 property. The human visible system adapts to perceived coloration primarily based on the encircling surroundings, which may result in shocking outcomes. We’ll have a look at one pertinent instance.
Simultaneous Distinction
Think about the next picture:

This picture exhibits 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 possibly can show this to your self by utilizing your favourite coloration choosing software or by trying on the beneath picture:

This illustrates a visible phenomenon referred to as simultaneous distinction. Readers who’re within the organic clarification 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 the next peak luminance (and oftentimes the next common luminance in observe), 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 telephone display grew to become “gray” or “washed out”.
We are able to see this phenomenon within the beneath picture. The gadget on the appropriate simulates how photographs could seem with an SDR UI, if these photographs had been rendered as HDR. Word that the August photographs look an identical 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 brilliant HDR is “allowed” to be. A UI that’s dominated by SDR, corresponding to a gallery view the place small quantities of HDR content material are displayed, can out of the blue seem like darker than anticipated.
When constructing your UI, think about the impression of HDR on textual content legibility or the looks of close by SDR property, 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 along with your SDR parts. In distinction, a UI that’s dominated by HDR, corresponding to full-screen video with out different UI parts on-top, doesn’t want to contemplate this as strongly, as the main focus of the UI is on the HDR content material itself. In these conditions, a 5x headroom (or increased, relying on content material metadata corresponding to 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 brilliant, particularly if there are different functions or system UI parts on-screen.
Learn how to management HDR headroom
Android 15 launched a management for desired HDR headroom. You possibly can have your utility request that the system makes use of a selected HDR headroom primarily based on the context round your required UI:
- In case you solely need to present SDR content material, merely request no headroom.
- In case you solely need to present HDR content material, then request a excessive HDR headroom as much as and in response to 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 could 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. // Word that the equal api on SurfaceView does NOT require // COLOR_MODE_HDR to constraint headroom, if there may be 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 (/* Combined, largely SDR */) { 1.5f } else { if ( /* Combined, largely HDR */) { 3f } else { /* HDR solely */ 5f } } }
Different platforms even have APIs that enable 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 Coloration HDR Module provides a constrained-high choice to constrain the headroom for combined HDR and SDR scenes. Inside the Apple ecosystem, constrainedHigh is equally coarse, reckoning with the challenges of displaying combined HDR and SDR scenes on client shows.
In case you are a developer who’s contemplating supporting HDR, be considerate about how HDR interacts along 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).

