androidimage-processingcolor-spacecolor-profilesrgb

Do i need to remove the p3 color gamut from an image before to send it to a device?


I have a web server that store user images and I need to know how to store each image (ie: my problem is to know if I need to store each picture with or without color space profile).

I don't quite understand how Color Space profile work. I know that android < Oreo support only sRGB, but are android device < Oreo able to convert for exemple P3 Color Space to sRGB ? or I absolutely need to send to these devices only sRGB pictures? I know that for example Instagram or 500px store each picture in both variants: with color profile and without color profile, but this means using twice storage :(

After how to convert efficiently P3 Color Space to sRGB?


Solution

  • If you think that an application in your chain will not be able to display your wide gamut images correctly, it is safer to convert them to the smallest common denominator, i.e sRGB.

    You can perform the conversion with many tools, e.g. Little CMS, GIMP, Photoshop will allow you to do it with the various gamut mapping algorithms ICC supports:

    Or you can just perform a naive straight conversion from DCI-P3 to sRGB by computing the transformation matrix and clipping out-of-gamut values, i.e. negative values. You can use this tool to compute the matrix, e.g. DCI-P3 to sRGB using CAT02 chromatic adaptation transform:

     1.1474451 -0.1450487 -0.0025531
    -0.0419136  1.0420663 -0.0000536
    -0.0174968 -0.0696506  1.0872218