Since the introduction of high dynamic range (HDR) video, streaming services have started streaming HDR video, focusing on full-screen experiences. Recently, social media apps have launched support for HDR video and Ultra HDR, indicating growing interest in HDR adoption across various apps.
Android support for HDR
The following are the milestones of Android's support for HDR technology over several years:
Android 7
- Initial support for HDR video decoding and display.
- Continued advancements in HDR capabilities.
Android 13
- End-to-end support for HDR video capture, encoding, and display.
- Introduction of Mixed SDR and HDR composition, defining different displayable luminance ranges between SDR and HDR.
Android 14
- Support for HDR images with Ultra HDR.
Screenshot support with HDR has also evolved and undergone a number of changes over the years.
Advancements in HDR screenshot capabilities
This section tracks the progression of HDR screenshot capability in recent Android updates.
Android 9
SurfaceFlinger, Android's graphics compositor, introduces HDR video support. GPU rendering of HDR video and screenshots is supported with a complex polynomial tone mapper. This tone-mapping curve isn't always equivalent to the display tone-mapper, so screenshots differ from the on-screen content.
Android 13
A tone mapping plugin is added to the SurfaceFlinger's GPU rendering block, enabling the OEM to provide a GPU shader to match their display's tone-mapping curve. Screenshots almost match what is on screen, but with the following differences:
- Screenshots remain in SDR format. Consequently, when viewed alongside an HDR scene, the HDR regions within the screenshot appear dimmer.
- SDR luminance isn't managed, resulting in SDR content within the screenshot appearing as bright as HDR content.
In other words, any HDR video captured in the screenshot is converted to SDR video.
Android 14
Ultra HDR poses a significant challenge to screenshotting. Unlike videos, images are typically rendered within the UI framebuffer, which has two main implications:
- Images can't have image processing, including tonemapping, that differs from the surrounding UI.
- Apps are responsible for source-based tone mapping when rendering their UI.
To alleviate this challenge, there are three potential screenshotting implementations:
- Preserve the HDR details of an Ultra HDR image, resulting in a darkened app UI in the screenshot.
- Preserve the app UI details, causing Ultra HDR image clipping.
- Compromise by brightening the app UI while clipping HDR highlights.
Android 14 implements the third approach of brightening the app UI and clipping HDR highlights.
Android 15-QPR1
SurfaceFlinger includes a local tone-mapping algorithm for screenshots. This process involves:
- Dividing the input image into smaller images.
- Computing the maximum luminance in each image, and discarding low luminance values within each section.
- Interpolating the computed luminances through blurring and resampling.
- Applying a parameterized Reinhard tonemapper to the input image, based on the interpolated luminance values.
This algorithm shows significant screenshot improvements between Android 14 and Android 15-QPR1, as shown in the following examples:
Example 1 is a screenshot of an HDR video overlaid on top of a Chrome page containing Ultra HDR. The UI colors are mostly preserved in the new implementation, and the image is no longer clipped.
Android 14 Android 15-QPR1 Figure 1. Comparison of Android 14 and Android 15-QPR1 for Example 1.
Example 2 is a screenshot of an HDR video overlaid on top of Settings with subsequent screenshots. In Android 14, the screenshot colors are successively darker. In Android 15-QPR1, the tonemapper correctly replicates and preserves the UI colors.
Android 14 Android 15-QPR1 Figure 2. Comparison of Android 14 and Android 15-QPR1 for Example 2.