Converting grayscale png affects bit depth
Posted: 2015-06-04T11:29:45-07:00
Hi,
I have 2 test scenarios:
First converting 16 bit Grayscale produces, 48 bit RGB.
Second converting 8 bit Grayscale produces, 24 bit RGB.
Tested using this image:
16 bit grayscale: http://cosmin.users.sourceforge.net/tes ... 6g_lin.png
8 bit grayscale: http://upload.wikimedia.org/wikipedia/c ... _image.png
performing these convert commands:
convert grayscale16.png grayscale16_2.png
Changes bit depth to 48 bit RGB
convert grayscale8.png grayscale8_2.png
changes bit depth to 24 bit RGB
I tested using ImageMagick 6.9.1-4
Debugged into png.c and seems like ping_have_color is defaulted to MagickTrue, and never gets set to MagickFalse, or somehow the logic needs to set ping_color_type=(png_byte) PNG_COLOR_TYPE_GRAY;
I have 2 test scenarios:
First converting 16 bit Grayscale produces, 48 bit RGB.
Second converting 8 bit Grayscale produces, 24 bit RGB.
Tested using this image:
16 bit grayscale: http://cosmin.users.sourceforge.net/tes ... 6g_lin.png
8 bit grayscale: http://upload.wikimedia.org/wikipedia/c ... _image.png
performing these convert commands:
convert grayscale16.png grayscale16_2.png
Changes bit depth to 48 bit RGB
convert grayscale8.png grayscale8_2.png
changes bit depth to 24 bit RGB
I tested using ImageMagick 6.9.1-4
Debugged into png.c and seems like ping_have_color is defaulted to MagickTrue, and never gets set to MagickFalse, or somehow the logic needs to set ping_color_type=(png_byte) PNG_COLOR_TYPE_GRAY;