Wrong colors after exporting 8bpc RGB png from 32f linear XCF
This is for GIMP-2.10.8 on Gentoo Linux updated within the last week.
Exporting an 8bpc RGB png from a 32f linear sRGB XCF produces wrong colors in ICC-profile color-managed applications:
Here's the XCF file:
Here's the resulting "normal.png" after exporting the image to disk as a png, which might look correct (if the browser or other image viewer is ignoring the embedded ICC profile), or might look wrong (if the browser or other image viewer is honoring the embedded ICC profile):
Here is a screenshot showing "normal.png" open in geeqie (ignores the embedded ICC profile for png files) and also in darktable (honors the embedded ICC profile for png files):
Here is exiftool output showing that GIMP built-in linear sRGB profile is embedded in the exported png:
` $ exiftool normal.png
ExifTool Version Number : 11.03
File Name : normal.png
. . . (stuff deleted to lessen the amount of reading)
Profile Creator : Little CMS
Profile ID : 0
Profile Description : GIMP built-in Linear sRGB
Profile Copyright : Public Domain
. . . (more stuff deleted)
Device Mfg Desc : GIMP
Device Model Desc : Linear sRGB
Image Size : 600x400
Megapixels : 0.240 `
The png file was exported encoded as a regular 8-bit sRGB image, as it almost always should be for 8-bit images. The only exception is users wanting to demonstrate that exporting linear 8-bit images isn't a good idea.
But the embedded ICC profile is the linear gamma sRGB profile used by the 32f XCF file, leading to wrong displayed colors for images opened in ICC profile color-managed applications that actually do read ICC profiles in pngs.
Suggestions to fix this issue:
By default export 8-bit sRGB files encoded in the regular (perceptually uniform) sRGB color space, which actually already seems to be the case for exporting pngs when choosing the 8bpc RGB option.
If the user chooses to embed the ICC profile upon exporting an 8-bit image, embed the perceptually uniform sRGB built-in profile, not the linear gamma sRGB built-in profile. Otherwise the image TRC encoding doesn't match the ICC profile TRC, producing wrong colors.
It would be nice if the export dialogs allowed the user to specify the ICC color space to convert the image to upon export, defaulting to regular (perceptually uniform) sRGB for pngs, jpegs, and any time the user is exporting an 8-bit image. But this would be an enhancement request, so not really part of this particular bug report.