I have a Google Pixel 7, which supports a wide-gamut display. I’ve noticed that when I view colors in the browser, for example, visiting this color page, and take a screenshot, the sRGB #FF0000 red is converted to Display P3 #EA3323 in the screenshot, as expected.
In my own Android app, I encounter the same behavior. If I draw a rectangle with #FF0000 (sRGB) on the screen, the color in the screenshot becomes #EA3323, matching the conversion from sRGB to Display P3.
The problem:
I want to display images that already have a Display P3 color profile, meaning the color inside the image is already in Display P3 (#EA3323 instead of sRGB #FF0000). However, when I take a screenshot of my app screen with this image inside, the color (#EA3323) is converted again to a Display P3 equivalent (#D84532), which results in a washed-out effect.
I want to prevent Display P3 images from being converted again when displayed on a Display P3 device. How can I do this?
Additional context:
I also draw shapes directly on the screen (SurfaceTexture
) using the sRGB color space, which works fine. I need this behavior to continue, where sRGB colors are converted to Display P3 (like converting #FF0000 to #EA3323).
The challenge is that I need to combine both worlds:
- Draw images that already have Display P3 colors without further conversion.
- Draw shapes with sRGB colors that get converted to Display P3.
How can I render Display P3 images without further color conversion while continuing to draw shapes in sRGB that automatically convert to Display P3?