Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
If I create a white circle on a black background and put it into the alpha channel of an opaque image and save to PNG24:, it properly removes the alpha channel
I understand. But it seemed strange to me that both files have an alpha channel. The first one with PNG24: turns it off. But the second one with the extra commands does not turn it off.
I would have left PNG24: off, but someone on the GIT web site asked about a similar command and I was surprised that it left the alpha channel on when explicitly adding PNG24:
Your png32 results have alpha channels with some semitransparent pixels (alpha neither 0 nor 1). I guess "convert" is having difficulty transforming that into PNG24 in which all transparent pixels need to be fully transparent and all of them have to be the same color. Forcing them all to have the same underlying color helps.
Glenn, sorry, I am confused. Here I only specify PNG24: and both images have the same alpha channel. The only difference is that one has image texture under the alpha and the other has black under the alpha. So why does one leave the alpha channel and the other remove it?
fmw42 wrote: ↑2017-06-13T18:30:40-07:00
Glenn, sorry, I am confused. Here I only specify PNG24: and both images have the same alpha channel. The only difference is that one has image texture under the alpha and the other has black under the alpha. So why does one leave the alpha channel and the other remove it?
I have answered this in the related GIT issue. The source image has transparent areas with different underlying colors. But a PNG24 RGB image uses the PNG tRNS chunk to identify a particular color that is transparent; all pixels with that RGB value are transparent and all others are opaque. So, when you try to convert an image with different-colored transparent pixels to PNG24, it fails. That's not a bug; it's a feature of the PNG format. Use PNG32 or indexed PNG with transparency instead of PNG24 for such images.