Wide Color Gamut image support

I did a test and uploaded an image in the DCI-P3 color spaced to see how the conversion would be managed when generating breakpoint images. Sadly all images were automatically converted to sRGB.

At least part of the blame seems to lie with the library handling the conversion: Sharp.

Sharp claims that it handles color spaces and profiles correctly but in digging around GitHub issues it seems like it simply forces all output to be sRGB. There are good reasons for this, but in this day and age the ability to show non-sRGB content is becoming more and more common as devices and software add support for it.

On the horizon there is a proposed change to Sharp that would add support for outputting images that aren’t using the sRGB color space: https://github.com/lovell/sharp/issues/1317

I hope that someone working on Strapi will consider adding support for WCG images when the time is right.

Apparently all images don’t always proudly announce in their metadata which color space they are, so being able to “force” images uploaded to a specific Media field to use a specific color space might be needed, though the automatic detection of color space would be the best solution.

Sharp has now made outputting to alternate color spaces possible (as of August): sharp - High performance Node.js image processing

Might be possible to add this as a plugin using the API in 4.0? Will investigate.