I\'ve got some PNG images with transparency, and I need to create versions with the image layer composed onto a white background. I\'ve tried various things with Image Magi
Using -flatten made me completely mad because -flatten in combination with mogrify crop and resizing simply doesn't work. The official and for me only correct way is to "remove" the alpha channel.
-alpha remove -alpha off (not needed with JPG)
See documention: http://www.imagemagick.org/Usage/masking/#remove
It appears that your command is correct so the problem might be due to missing support for PNG (). You can check with convert -list configure
or just try the following:
sudo yum install libpng libpng-devel
This works for me:
convert -flatten img1.png img1-white.png
-flatten
is equivalent to -layers flatten
)The only one that worked for me was a mix of all the answers:
convert in.png -background white -alpha remove -flatten -alpha off out.png