Using external grayscale color profiles causes sRGB conversions
GIMP version: 2.10.22
Operating System: Windows
Package: Installer from gimp.org
Description of the bug
When using the gimp_layer_flatten procedure to remove the alpha channel on a 16-bit grayscale image without transparent pixels I'm seeing the following color profile conversions:
gimp_color_transform_new: using babl for 'EPSON Gray - Gamma 2.2' -> 'GIMP built-in sRGB'
gimp_color_transform_new: using babl for 'GIMP built-in sRGB' -> 'EPSON Gray - Gamma 2.2'
gimp_color_transform_new: using babl for 'EPSON Gray - Gamma 2.2' -> 'GIMP built-in sRGB'
gimp_color_transform_new: using babl for 'GIMP built-in sRGB' -> 'EPSON Gray - Gamma 2.2'
This does not happen when using the GIMP built-in D65 Grayscale profile, so I was initially concerned the entire layer was being converted between those color spaces possibly losing precision in the process.
After some reading through the source code, I'm thinking this conversion is actually happening in this line of gimp_gegl_create_flatten_node():
c = gimp_gegl_color_new (background, space);
This would mean only the context background color is being converted back and forth. However it still seems suspicious enough to be worth reporting.
Reproduction
Is the bug reproducible? Always
Reproduction steps:
- Open GIMP with the console window (using the -c command-line arg)
- Create a 16-bit grayscale with the following color profile EPSON__Gray_-_Gamma_2.2.icc or use this test image:
- Remove the alpha layer from the image
- Observe Gray <-> sRGB color profile conversions in the console window
Expected result: Either no conversions or conversions with the Built-in D65 Grayscale color profile
Actual result: Conversions between the external grayscale profile and the built-in sRGB color profile
Additional information
No Additional information