Mike Dooley
Mike Dooley

Reputation: 976

imagemagick: background stays white

I tried to convert a pdf to an image:

convert -verbose
        -density 150
        -trim example.pdf
        -quality 100
        -background white
         output.png

Unfortunately it seems as if the presence of the background keyword has no influence on the output image because the final background stays transparent.

Upvotes: 0

Views: 39

Answers (2)

Mike Dooley
Mike Dooley

Reputation: 976

adding

-background white -alpha remove

did the trick

Upvotes: 0

Glenn Randers-Pehrson
Glenn Randers-Pehrson

Reputation: 12465

You also need the "-flatten" option, to compose your transparent image against the white background.

By the way, don't use "-quality 100"; it doesn't mean what you think it does, when writing a PNG file. 95 would work better.

Upvotes: 1

Related Questions