
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 consumer interface, you have to be cautious when your consumer interface is primarily SDR colours and property. The human visible system adapts to perceived colour based mostly on the encompassing setting, which might result in shocking outcomes. We’ll take a look at one pertinent instance.
Simultaneous Distinction
Contemplate the next picture:

This picture exhibits two grey rectangles with totally different background colours. For most individuals viewing this picture, the 2 grey rectangles look like totally 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 colour selecting software or by wanting on the beneath picture:

This illustrates a visible phenomenon referred to as simultaneous distinction. Readers who’re within the organic rationalization could be taught extra right here.
Close by variations in colour are subsequently “emphasised”: colours seem darker when instantly subsequent to brighter colours. That very same colour would seem lighter when instantly subsequent to darker colours.
Implications on Mixing HDR and SDR
The impact of simultaneous distinction impacts the looks of consumer interfaces that must current a combination 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 seem dimmer though technically the SDR content material luminance has not modified in any respect. For customers, this may be expressed as: my cellphone display screen grew to become “gray” or “washed out”.
We will see this phenomenon within the beneath picture. The machine on the fitting simulates how images could seem with an SDR UI, if these images have been rendered as HDR. Word that the August images look equivalent when put next 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, comparable to a gallery view the place small quantities of HDR content material are displayed, can out of the blue look like darker than anticipated.
When constructing your UI, contemplate the affect of HDR on textual content legibility or the looks of close by SDR property, and use the suitable APIs supplied 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 components. In distinction, a UI that’s dominated by HDR, comparable to full-screen video with out different UI components 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 comparable to UltraHDR‘s max_content_boost) could also be extra applicable.
It is likely to be tempting to “brighten” SDR content material as an alternative. Resist this temptation! It will trigger your software to be too vivid, particularly if there are different purposes or system UI components on-screen.
management HDR headroom
Android 15 launched a management for desired HDR headroom. You possibly can have your software request that the system makes use of a specific HDR headroom based mostly on the context round your required UI:
- If you happen to solely need to present SDR content material, merely request no headroom.
- If you happen to solely need to present HDR content material, then request a excessive HDR headroom as much as and in keeping with the calls for of the content material.
- If you wish to present a combination of HDR and SDR content material, then can request an intermediate headroom worth accordingly. Typical headroom quantities could be round 2x for a blended 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's HDR content material displayed // on the SurfaceView. window.colorMode = ActivityInfo.COLOR_MODE_HDR // Illustrative values: totally 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, principally SDR */) { 1.5f } else { if ( /* Combined, 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 software.
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 blended HDR and SDR scenes. Inside the Apple ecosystem, constrainedHigh is equally coarse, reckoning with the challenges of displaying blended HDR and SDR scenes on shopper shows.
If you’re 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).
