1

I'm developing a canvas web application converting colors of an image from Display P3 to sRGB using the relative colorimetric gamut mapping algorithm (in-gamut colors are rounded/aligned, out-of-gamut colors are clamped).

Before actual conversion, I need to have a preview figuring out which colors will be out-of-gamut and showing those out-of-gamut pixels with a fallback color (like black or cyan).

So the process blocked here:

function isOutOfGamut(colorXYZ, colorSpaceInfo){
  // TODO
}
  • colorXYZ is a color described in CIE XYZ
  • colorSpaceInfo contains all information about a color space, can be extracted from some ICC color profile
Kornel
  • 97,764
  • 37
  • 219
  • 309
fuweichin
  • 1,398
  • 13
  • 14
  • This problem seems to be quite complex, I break it into three parts. part 1: extract color space info (whitepoint, primary colors, OETF, ...) from an ICC profile, part 2: build a 3D geometry for the color space, part 3: check if a point is inside the 3D geometry. – fuweichin Jul 28 '23 at 16:28

0 Answers0