Set background color: opposite - transparent

Say I have a PNG with transparent pixels, how can I translate them into solid color?

(Note that this is slightly different from this question , because I want to replace it with an arbitrary color. White is β€œspecial” in ImageMagick, as the accepted answer indicates that it does not mention white).

+8
imagemagick
source share
1 answer

For me, the following works (ImageMagick 6.6.3-1):

convert in.png -background "#FF0000" -flatten out.png 

Just change the red color to whatever suits you.

+19
source share

All Articles