How to remove the alpha channel during convert
Posted: 2015-08-06T05:46:45-07:00
I am trying to position an image on a background and add some text to it.
in.png is an image of solid colour which uses the alpha channel to create the visible image (imagine something cut out of color paper). The result is what I want it to be, except for the fact that the output tif has got an alpha channel. I tried all of the -alpha commands, such as
and also -alpha off which is not listed in that documentation, even combined two -alpha commands, but any of the out.tif files still have got an alpha channel when opening it in GIMP. Which is the way to create a 3x8 bit color tiff without alpha channel from an input image that has got alpha channel, such that the visible pixels remain and the transparent pixels are replaced by the given background color?
ImageMagick version: ImageMagick 6.8.6-8 2013-08-04 Q16
Environment: Windows 7 Ultimate, 64 bit
Usage: from prompt (cmd.exe)
Code: Select all
convert in.png -background #cccccc -extent 500x150-25-25 -gravity center -annotate 0 "some text" out.tif
Code: Select all
convert in.png -background #cccccc -alpha remove -extent 500x128-32-32 -gravity center -annotate 0 "some text" out.tif
ImageMagick version: ImageMagick 6.8.6-8 2013-08-04 Q16
Environment: Windows 7 Ultimate, 64 bit
Usage: from prompt (cmd.exe)