26.7 C
New York
Saturday, August 9, 2025

Buy now

spot_img

Android Builders Weblog: What’s HDR?



Android Builders Weblog: What’s HDR?

Posted by John Reck – Software program Engineer

For Android builders, delivering distinctive visible experiences is a steady purpose. Excessive Dynamic Vary (HDR) unlocks new prospects, providing the potential for extra vibrant and immersive content material. Applied sciences like UltraHDR on Android are notably compelling, offering the advantages of HDR shows whereas sustaining essential backwards compatibility with SDR shows. On Android you need to use HDR for each video and pictures.

Through the years, the time period HDR has been used to suggest various associated, however in the end distinct visible constancy options. Customers encounter it within the context of digicam options (publicity fusion), or as a advertising time period in TV or monitor (“HDR succesful”). This conflates distinct options like wider shade gamuts, elevated bit depth or enhanced distinction with HDR itself.

From an Android Graphics perspective, HDR primarily signifies larger peak brightness functionality that extends past the traditional Customary Dynamic Vary. Different perceived advantages typically derive from requirements akin to HDR10 or Dolby Imaginative and prescient which additionally embody the utilization of wider shade areas, larger bit depths, and particular switch capabilities.

On this article, we’ll set up the foundational shade rules, then tackle widespread myths, make clear HDR’s position within the rendering pipeline, and look at how Android’s show applied sciences and APIs allow HDR expertise.

The parts of shade

Understanding HDR begins with defining the three main parts that type the displayed quantity of shade: bit depth, switch perform, and shade gamut. These describe the precision, scaling, and vary of the colour quantity, respectively.

Whereas a shade mannequin defines the format for encoding pixel values (e.g., RGB, YUV, HSL, CMYK, XYZ), RGB is usually assumed in a graphics context. The mixture of a shade mannequin, a shade gamut, and a switch perform constitutes shade area. Examples embody sRGB, Show P3, Adobe RGB, BT.2020, or BT.2020 HLG. Quite a few mixtures of shade gamut and switch perform are attainable, resulting in quite a lot of shade areas.

components of color include bit depth + transfer fn + color gamut + color model with the last three being within the color space

Elements of shade

Bit Depth

Bit depth defines the precision of shade illustration. The next bit depth permits for finer gradation between shade values. In fashionable graphics, bit depth usually refers to bits per channel (e.g., an 8-bit picture makes use of 8 bits for every crimson, inexperienced, blue, and optionally alpha channel).

Crucially, bit depth doesn’t decide the general vary of colours (minimal and most values) a picture can characterize; that is set by the colour gamut and, in HDR, the switch perform. As a substitute, rising bit depth gives extra discrete steps inside that outlined vary, leading to smoother transitions and decreased visible artifacts akin to banding in gradients.

5-bit

5-bit color gradient showing distinct transition between color values

8-bit

8-bit color gradient showing smoother transition between color values

Though 8-bit is without doubt one of the commonest codecs in widespread utilization, it’s not the one possibility. RAW photographs could be captured at 10, 12, 14, or 16 bits. PNG helps 16 bits. Video games steadily use 16-bit floating level (FP16) as a substitute of integer area for intermediate render buffers. Trendy GPU APIs like Vulkan even assist 64-bit RGBA codecs in each integer and floating level varieties, offering as much as 256-bits per pixel.

Switch Perform

A switch perform defines the mathematical relationship between a pixel’s saved numerical worth and its closing displayed luminance or shade. In different phrases, the switch perform describes how one can interpret the increments in values between the minimal and most. This perform is crucial as a result of the human visible system’s response to gentle depth is non-linear. We’re extra delicate to modifications in luminance at low gentle ranges than at excessive gentle ranges. Subsequently, a linear mapping from saved values to show luminance wouldn’t lead to an environment friendly utilization of the accessible bits. There can be greater than vital precision within the brighter area and too little within the darker area with respect to what’s perceptual. The switch perform compensates for this non-linearity by adjusting the luminance values to match the human visible response.

Whereas some switch capabilities are linear, most make use of complicated curves or piecewise capabilities to optimize picture high quality for particular shows or viewing circumstances. sRGB, Gamma 2.2, HLG, and PQ are widespread examples, every prioritizing bit allocation otherwise throughout the luminance vary.

Coloration Gamut

Coloration gamut refers back to the total vary of colours {that a} explicit shade area or gadget can precisely reproduce. It’s usually a subset of the seen shade spectrum, which encompasses all the colours that the human eye can understand. Every shade area (e.g., sRGB, Show P3, BT2020) defines its personal distinctive gamut, establishing the boundaries for shade illustration.

A wider gamut signifies that the colour area can show a higher number of colours, resulting in richer and extra vibrant photographs. Nonetheless, merely having a bigger gamut would not at all times assure higher shade accuracy or a extra vibrant outcome. The gadget or medium used to show the colours should even be able to reproducing the complete vary of the gamut. When a show encounters colours outdoors its reproducible gamut, the standard dealing with technique is clipping. That is to make sure that in-gamut colours are correctly preserved for accuracy, as in any other case makes an attempt to scale the colour gamut might produce disagreeable outcomes, notably in areas through which human imaginative and prescient is especially delicate like pores and skin tones.

HDR myths and realities

With an understanding of what kinds the fundamental working shade rules, it’s now time to judge a few of the widespread claims of HDR and the way they apply in a normal graphics context.

Declare: HDR gives extra vibrant colours

This declare comes from HDR video usually utilizing the BT2020 shade area, which is certainly a large shade quantity. Nonetheless, there are a number of issues with this declare as a blanket assertion.

The primary is that photographs and graphics have been ready to make use of wider shade gamuts, akin to Show P3 or Adobe RGB, for fairly a very long time now. This isn’t a novel development that was coupled to HDR. In JPEGs for instance that is outlined by the ICC profile, which dates again to the early Nineteen Nineties, though wide-spread adoption of ICC profile dealing with is considerably more moderen. Equally on the graphics rendering aspect the utilization of wider shade areas is absolutely decoupled from whether or not or not HDR is getting used.

The second is that not all HDR movies even use such a wider gamut in any respect. Though HDR10 specifies the utilization of BT2020, different HDR codecs have since been created that don’t use such a large gamut.

The most important difficulty, although, is one in all capturing and displaying. Simply because the format permits for the colour gamut of BT2020 doesn’t imply that your complete gamut is definitely usable in apply. For instance present Dolby Imaginative and prescient mastering tips solely require a 99% protection of the P3 gamut. Which means even for high-end skilled content material, it’s not anticipated that the authoring of content material past that of Show P3 is feasible. Equally, the overwhelming majority of shopper shows at present are solely able to displaying both sRGB or Show P3 shade gamuts. On condition that the standard suggestion of out-of-gamut colours is to clip them, which means regardless that HDR10 permits for as much as BT2020 gamut, the widest gamut in apply continues to be going to be P3.

Thus this declare ought to actually be thought-about one thing supplied by HDR video profiles when in comparison with SDR video profiles particularly, though SDR movies may use wider gamuts if desired with out utilizing an HDR profile.

Declare: HDR gives extra distinction / higher black element

One of many advantages of HDR typically claimed is darkish blacks (e.g. Dolby Imaginative and prescient Demo #3 – Core Universe – 4K HDR or “Darkish scenes come alive with darker darks” ) or extra element in the dead of night areas. That is even mirrored in BT.2390: “HDR additionally permits for decrease black ranges than conventional SDR, which was usually within the vary between 0.1 and 1.0 cd/m2 for cathode ray tubes (CRTs) and is now within the vary of 0.1 cd/m2 for most traditional SDR liquid crystal shows (LCDs).” Nonetheless, in actuality no show makes an attempt to point out something however SDR black because the blackest black the show is bodily able to. Thus there isn’t any distinction between HDR or SDR when it comes to how darkish it may possibly attain – each backside out on the identical darkish stage on the identical show.

As for distinction ratio, as that’s the ratio between the brightest white and the darkest black, it’s overwhelmingly influenced by how darkish a show can get. With the prevalence of OLED shows, notably within the cell area, each SDR and HDR have the identical distinction ratio in consequence, as they each have primarily good black ranges giving them infinite distinction ratios.

The PQ switch perform does allocate extra bits to the darkish area, so in principle it may possibly convey higher black element. Nonetheless, it is a distinctive facet of PQ fairly than a characteristic of HDR. HLG is more and more the extra widespread HDR format as it’s most popular by cell cameras in addition to a number of excessive finish cameras. And whereas PQ might include this element, that doesn’t imply the HDR show can essentially show it anyway, as mentioned in Show Realities.

Declare: HDR gives larger bit depth

This declare comes from HDR10 and a few, however not all, Dolby Imaginative and prescient profiles utilizing 10 or 12-bits for the video stream. Just like extra vibrant colours, that is actually simply a facet of explicit video profiles fairly than one thing HDR itself inherently gives or is coupled to HDR. The utilization of 10-bits or extra is in any other case not unusual in imaging, notably within the larger finish images world, with RAW and TIFF picture codecs able to having 10, 12, 14, or 16-bits. Equally, PNG helps 16-bits, though that’s not often used.

Declare: HDR gives larger peak brightness

This then, is all that HDR actually is. However what does “larger peak brightness” actually imply? In any case, SDR shows have been pushing ever rising brightness ranges earlier than HDR was important, notably for daylight viewing. And even with out that, what’s the distinction between “HDR” and simply “SDR with the brightness slider cranked up”? The reply is that we outline “HDR” as having a brightness vary larger than SDR, and we consider SDR as being the vary pushed by autobrightness to be comfortably readable within the present ambient circumstances. Thus we outline HDR when it comes to issues like “HDR headroom” or “HDR/SDR ratio” to point it’s a floating area relative to SDR. This makes brightness insurance policies simpler to purpose about. Nonetheless, it does complicate the interplay with conventional HDR akin to that utilized in video, particularly HLG and PQ content material.

PQ/HLG switch capabilities

PQ and HLG characterize the 2 commonest approaches to HDR when it comes to video content material. They characterize two switch capabilities that characterize totally different ideas of what’s “HDR.” PQ, printed as SMPTE ST 2084:2014, is outlined when it comes to absolute nits within the show. The expectation is that it encodes from 0 to 10,000 nits, and expects to be mastered for a selected reference viewing surroundings. HLG takes a special strategy, as a substitute opting to take a typical gamma curve for a part of the vary earlier than switching to logarithmic for the brighter portion. This has a claimed nominal peak brightness of 1000 nits within the reference surroundings, though it isn’t outlined in absolute luminance phrases like PQ is.

Trade-wide specs have just lately formalized the brightness vary of each PQ- and HLG-encoded content material in relation to SDR. ITU-R BT. 2408-8 defines the reference white stage for graphics to be 203 nits. ISO/TS 22028-5 and ISO/PRF 21496-1 have adopted swimsuit; 21496-1 particularly defines HDR headroom when it comes to nominal peak luminance, relative to a diffuse white luminance at 203 nits.

The realities of recent shows, mentioned beneath, in addition to typical viewing environments imply that conventional HDR video are almost by no means displayed as supposed. A show’s HDR headroom might evaporate underneath brilliant viewing circumstances, demanding an on-demand tonemapping into SDR. Conventional HDR video encodes a hard and fast headroom, whereas fashionable shows make use of a dynamic headroom, leading to huge variations in video high quality even on the identical show.

Show Realities

Up to now a lot of the dialogue round HDR has been from the angle of the content material. Nonetheless, customers devour content material on a show, which has its personal capabilities and extra importantly limits. A high-end cell show is prone to have traits akin to gamma 2.2, P3 gamut, and a peak brightness of round 2000 nits. If we then take into account one thing like HDR10 there are mismatches in bit utilization prioritization:

    • PQ’s elevated bit allocation on the decrease ranges finally ends up being wasted
    • The utilization of BT2020 finally ends up spending bits on elements of a gamut that may by no means be displayed
    • Encoding as much as 10,000 nits of brightness is equally headroom that’s not utilized

These mismatches aren’t inherently an issue, nevertheless, but it surely signifies that as 10-bit shows change into extra widespread the present 10-bit HDR video profiles are unable to really make the most of the complete show’s capabilities. Thus HDR video profiles are ready of concurrently being ahead trying whereas additionally already being unable to maximise a present 10-bit show’s capabilities. That is the place expertise akin to Extremely HDR or gainmaps normally present a compelling various. Regardless of typically utilizing an 8-bit base picture, as a result of the acquire layer that transforms it to HDR is specialised to the content material and its explicit vary wants it’s extra environment friendly with its bit utilization, resulting in outcomes that also look gorgeous. And as that base picture is upgraded to 10-bit with newer picture codecs akin to AVIF, the efficient bit utilization is even higher than these of typical HDR video codecs. Thus these approaches don’t characterize evolutionary or stepping stones to “true HDR”, however fairly are additionally an enchancment on HDR along with having higher backwards compatibility. Equally Android’s UI toolkit’s utilization of the extendedRangeBrightness API really nonetheless primarily occurs in 8-bit area. As a result of the rendering is tailor-made to the particular show and present circumstances it’s nonetheless attainable to have a very good HDR expertise regardless of the utilization of RGBA_8888.

Unlocking HDR on Android: Subsequent steps

Excessive Dynamic Vary (HDR) gives development in visible constancy for Android builders, transferring past the normal constraints of Customary Dynamic Vary (SDR) by enabling larger peak brightness.

By understanding the core parts of shade – bit depth, switch perform, and shade gamut – and debunking widespread myths, builders can leverage applied sciences like Extremely HDR to ship actually immersive experiences which are each visually gorgeous and backward suitable.

In our subsequent article, we’ll delve into the nuances of HDR and consumer intent, exploring how one can optimize your content material for various show capabilities and viewing environments.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Stay Connected

0FansLike
0FollowersFollow
0SubscribersSubscribe
- Advertisement -spot_img

Latest Articles

Hydra v 1.03 operacia SWORDFISH