So, this is both a bug and a feature of imagemagic. To quote the feature part:
It turns out ImageMagick tries to set to PNG8 based on image content even if the file was previously PNG24 or PNG32
Therefore, if you want to end up with 3 channels per image, you have to set png24
format (3
channels x
8
bits/channel).
So the solution is:
# for a single image, with a different output
convert input.png -type TrueColor png24:output.png
# for a batch of images, IN_PLACE !!! BE VERY CAREFUL
mogrify -define png:format=png24 -type TrueColor *.png
It's mandatory to realise that mogrify
will modify them in place so make sure this is what you want, as there is no way to recover the original images.