mahemoff
mahemoff

Reputation: 46369

Set Background color: Opposite of -transparent

Say I have a PNG with transparent pixels, how could I translate them to a solid color?

(Note this is slightly different to this question as I'm looking to replace with an arbitrary color. White is "special" in ImageMagick, as the accepted answer there indicates by the fact it omits to mention white).

Upvotes: 9

Views: 8346

Answers (1)

Maehler
Maehler

Reputation: 6331

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

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

Just swap the red color to whatever suits your needs.

Upvotes: 21

Related Questions