Great stuff! I really appreciate the time and effort you put into this issue, as well as GM in general.
The image was AI-generated, I believe, so the dirtiness is not surprising. The ImageMagick issue https://github.com/ImageMagick/ImageMagick/issues/8200 has not been updated since the day I filed it. I'm not clear whether the promised change was merged, but there's nothing to indicate that it has been.
Thanks for this. As you can probably tell, the project is somewhat moribund at present. I hope to find time to build on some of the excellent work that has been done elsewhere to revive it soon; but in the mean time there are forks such as https://codeberg.org/sox_ng/sox_ng/ that are being actively worked on.
Thanks, that's very interesting background. I hadn't realised that IM writes only up to 16 colours; I checked, but I can't see any mention of it above. The IM folk are in the process of improving PNG8 output; see: https://github.com/ImageMagick/ImageMagick/issues/8200 but at the same time changing what PNG8 means as far as IM is concerned, I guess.
I think this issue can be closed, at any rate (or maybe you're waiting until the next release?): anyway, GM no longer produces an invalid PNG in this case.
Yes, I see the warning. What I didn't realise is that the original image has those speckles; it seems then that the behavior is quite reasonable; sorry!
Here's the image attachment.
I attach the processed image, in case it's different from what you're getting. Do let me know if it's not obvious what's wrong with it. (My claim, recall, is that the conversion to indexed PNG is now buggy.)