2025 年 3 月 27 日より、AOSP のビルドとコントリビューションには aosp-main
ではなく android-latest-release
を使用することをおすすめします。詳細については、AOSP の変更をご覧ください。
Android の HDR スクリーンショット
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
ハイ ダイナミック レンジ(HDR)動画の登場以来、ストリーミング サービスは全画面での視聴体験を重視して HDR 動画のストリーミングを開始しました。最近では、ソーシャル メディア アプリが HDR 動画やウルトラ HDR のサポートを開始しており、さまざまなアプリで HDR 導入に対する関心が高まっていることがうかがえます。
Android での HDR のサポート
Android では、この数年間で HDR テクノロジーのサポートに関して次のような重要な取り組みを行ってきました。
Android 7
- HDR 動画のデコードと表示のサポートを開始。
- HDR 機能を継続的に改善。
Android 13
- HDR 動画のキャプチャ、エンコード、表示のエンドツーエンドのサポート。
- SDR と HDR の混合構成を導入し、SDR と HDR で異なる表示可能な輝度範囲を定義。
Android 14
HDR でのスクリーンショットのサポートもここ数年で進化し、多くの変更が加えられています。
HDR スクリーンショット機能の進歩
このセクションでは、最近の Android のアップデートにおける HDR スクリーンショット機能の進歩について説明します。
Android 9
Android のグラフィック コンポジタである SurfaceFlinger に HDR 動画のサポートが導入されています。また、複雑な多項式トーンマッパーでの HDR 動画やスクリーンショットの GPU レンダリングがサポートされています。このトーン マッピング曲線はディスプレイのトーンマッパーと常に同じであるとは限らないため、スクリーンショットは画面上のコンテンツとは異なります。
Android 13
トーン マッピング プラグインが SurfaceFlinger の GPU レンダリング ブロックに追加され、OEM がディスプレイのトーン マッピング曲線に一致させるための GPU シェーダーを提供できるようになりました。スクリーンショットは画面上に表示されているものとほぼ同じですが、次のような違いがあります。
- スクリーンショットは SDR フォーマットのままです。そのため、HDR のシーンと見比べると、スクリーンショット内の HDR の範囲は暗くなります。
- SDR 輝度は管理されないため、スクリーンショット内の SDR コンテンツは HDR コンテンツと同程度の明るさになります。
つまり、スクリーンショットでキャプチャされた HDR 動画は SDR 動画に変換されるということです。
Android 14
ウルトラ HDR でのスクリーンショットには大きな課題が存在します。動画とは違い、画像は通常 UI フレームバッファ内でレンダリングされます。これによる影響には主に次の 2 つがあります。
- 画像では、トーン マッピングを含め、周囲の UI と異なる画像処理を行うことができません。
- UI のレンダリング時、アプリがソースベースのトーン マッピングを実行します。
この課題を軽減するためにスクリーンショットで実装可能な方法としては、次の 3 つがあります。
- ウルトラ HDR 画像の HDR の詳細を保持し、スクリーンショット内のアプリの UI を暗くする。
- アプリの UI の詳細を保持し、ウルトラ HDR 画像をクリップする。
- HDR のハイライトをクリップしつつアプリの UI を明るくすることで調整する。
Android 14 では、アプリの UI を明るくし、HDR のハイライトをクリップするという 3 番目の方法を採用しています。
Android 15-QPR1
SurfaceFlinger にはスクリーンショットのローカル トーン マッピング アルゴリズムが含まれています。このプロセスでは次のことを行います。
- 入力画像を小さな画像に分割する。
- 各画像の最大輝度を計算し、各セクション内の低輝度値を破棄する。
- 計算した輝度をぼかしとリサンプリングを使って補間する。
- 補間された輝度値に基づいて、パラメータ化されたラインハルト トーンマッパーを入力画像に適用する。
次の例に示すように、Android 14 から Android 15-QPR1 にかけては、このアルゴリズムによりスクリーンショットが大幅に改善されています。
例 1 はウルトラ HDR を含む Chrome のページ上に重なった HDR 動画のスクリーンショットです。新しい実装では UI の色はほぼ保持され、画像がクリップされることもありません。
Android 14 |
Android 15-QPR1 |
|
|
図 1. 例 1 での Android 14 と Android 15-QPR1 の比較
例 2 は [設定] の上に重なった HDR 動画のスクリーンショットと、続けて撮ったスクリーンショットです。Android 14 ではスクリーンショットの色が段々と暗くなっています。Android 15-QPR1 では、トーンマッパーによって UI の色が正しく再現され、保持されています。
Android 14 |
Android 15-QPR1 |
|
|
図 2. 例 2 での Android 14 と Android 15-QPR1 の比較
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-03-10 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-03-10 UTC。"],[],[],null,["# HDR in Android screenshots\n\nSince the introduction of high dynamic range (HDR) video, streaming services\nhave started streaming HDR video, focusing on full-screen\nexperiences. Recently, social media apps\nhave launched support for HDR video and Ultra HDR,\nindicating growing interest in HDR adoption across various apps.\n\nAndroid support for HDR\n-----------------------\n\nThe following are the milestones of Android's support for HDR technology over\nseveral years:\n\n### Android 7\n\n- Initial support for HDR video decoding and display.\n- Continued advancements in HDR capabilities.\n\n### Android 13\n\n- End-to-end support for HDR video capture, encoding, and display.\n- Introduction of [Mixed SDR and HDR composition](/docs/core/display/mixed-sdr-hdr), defining different displayable luminance ranges between SDR and HDR.\n\n### Android 14\n\n- Support for HDR images with [Ultra HDR](https://developer.android.com/media/grow/ultra-hdr).\n\nScreenshot support with HDR has also evolved and undergone a number of changes\nover the years.\n\nAdvancements in HDR screenshot capabilities\n-------------------------------------------\n\nThis section tracks the progression of HDR screenshot capability in recent\nAndroid updates.\n\n### Android 9\n\nSurfaceFlinger, Android's graphics compositor, introduces HDR video support. GPU\nrendering of HDR video and screenshots is supported with a complex polynomial\ntone mapper. This tone-mapping curve isn't always equivalent to the display\ntone-mapper, so screenshots differ from the on-screen content.\n\n### Android 13\n\nA [tone mapping](/docs/core/display/tone-mapping) plugin is added to the\nSurfaceFlinger's GPU rendering block, enabling the OEM to provide a GPU shader\nto match their display's tone-mapping curve. Screenshots almost match what is on\nscreen, but with the following differences:\n\n- Screenshots remain in SDR format. Consequently, when viewed alongside an HDR scene, the HDR regions within the screenshot appear dimmer.\n- SDR luminance isn't managed, resulting in SDR content within the screenshot appearing as bright as HDR content.\n\nIn other words, any HDR video captured in the screenshot is converted to SDR\nvideo.\n\n### Android 14\n\nUltra HDR poses a significant challenge to screenshotting. Unlike videos, images\nare typically rendered within the UI framebuffer, which has two main\nimplications:\n\n- Images can't have image processing, including tonemapping, that differs from the surrounding UI.\n- Apps are responsible for source-based tone mapping when rendering their UI.\n\nTo alleviate this challenge, there are three potential screenshotting\nimplementations:\n\n- Preserve the HDR details of an Ultra HDR image, resulting in a darkened app UI in the screenshot.\n- Preserve the app UI details, causing Ultra HDR image clipping.\n- Compromise by brightening the app UI while clipping HDR highlights.\n\nAndroid 14 implements the third approach of brightening the app UI and clipping\nHDR highlights.\n\n### Android 15-QPR1\n\nSurfaceFlinger includes a local tone-mapping algorithm for screenshots. This\nprocess involves:\n\n- Dividing the input image into smaller images.\n- Computing the maximum luminance in each image, and discarding low luminance values within each section.\n- Interpolating the computed luminances through blurring and resampling.\n- Applying a parameterized Reinhard tonemapper to the input image, based on the interpolated luminance values.\n\nThis algorithm shows significant screenshot improvements between Android 14 and\nAndroid 15-QPR1, as shown in the following examples:\n\n- Example 1 is a screenshot of an HDR video overlaid on top of a Chrome\n page containing Ultra HDR. The UI colors are mostly preserved in the new\n implementation, and the image is no longer clipped.\n\n | Android 14 | Android 15-QPR1 |\n |------------|-----------------|\n | | |\n\n **Figure 1.** Comparison of Android 14 and Android 15-QPR1 for Example 1.\n- Example 2 is a screenshot of an HDR video overlaid on top of **Settings**\n with subsequent screenshots. In Android 14, the screenshot colors are\n successively darker. In Android 15-QPR1, the tonemapper correctly replicates and\n preserves the UI colors.\n\n | Android 14 | Android 15-QPR1 |\n |------------|-----------------|\n | | |\n\n **Figure 2.** Comparison of Android 14 and Android 15-QPR1 for Example 2.\n\n### Android 16\n\nSimilar to [Ultra HDR](https://developer.android.com/media/platform/hdr-image-format),\nHDR screenshots store a gainmap in the screenshot file to recover the HDR\nrepresentation during rendering. However, unlike Ultra HDR, the screenshot\nremains in a PNG format for backward compatibility with systems that ingest\nPNG screenshots.\n\nThe screenshot generation details are as follows:\n\n- When HDR content is displayed on the device, a screenshot is generated using FP16 pixels.\n- The local tone-mapper described in [Android 15-QPR1](/docs/core/graphics/hdr-screenshots#android15qpr-hdr-shot) generates an 8-bit base SDR rendition.\n- An 8-bit gainmap is produced by combining the SDR base rendition with the HDR rendition.\n- The SDR base rendition and the gainmap are encoded into a single PNG file.\n\nThe PNG encoding details are as follows:\n\n- The gainmap is encoded as a PNG image, which includes a gmAP chunk, containing the [ISO 21496-1](https://www.iso.org/standard/86775.html) metadata for the gainmap.\n- The SDR base rendition is encoded as a PNG image, which includes a gmAP chunk, containing the version of the [ISO 21496-1](https://www.iso.org/standard/86775.html) metadata. This PNG image also includes a gdAT chunk, containing the entirety of the encoded gainmap PNG.\n\nThe following figure shows the layout of the PNG chunks:\n\n**Figure 3.** Layout of the PNG chunks.\n\nWith Android 16, the PNG codec supports both encoding\nand decoding of these PNGs. Apps can display a PNG with a gainmap in the same\nmanner as [Ultra HDR](https://developer.android.com/media/grow/ultra-hdr/display)."]]