Вопрос

When converting a PDF with images with transparency, the output ends up with a black background

convert -density 300 -background white -alpha off \
-resize 80x80 -strip -quality 70 file.pdf[0] thumb.jpg[0]

Have tried to set the background to white and deactivate alpha, but the background still ends up black!?

Test file

http://www.bluemachines.dk/pdf/trans.pdf

Have tested on these two versions so it looks like a generel "issue"

ImageMagick-6.8.8-10

ImageMagick-6.7.7-10

update

# /var/bin/ImageMagick-6.8.8-10/utilities/convert
Version: ImageMagick 6.8.8-10 Q16 x86_64 2014-04-10

 # gs -v
GPL Ghostscript 9.14 (2014-03-26)

Here is the output file

http://www.bluemachines.dk/pdf/thumb.jpg

-debug ALL

Can't post that much in the body so the output is pasted into this txt file

http://www.bluemachines.dk/pdf/debug.txt

Это было полезно?

Решение

You should use -alpha remove instead of -alpha off. And I would advise you to change the order of your arguments to this:

convert -density 300 file.pdf[0] -resize 80x80 -background white -alpha remove \
-strip -quality 70 thumb.jpg
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top