Question

I'm converting pdf files to images with ImageMagic, everything is ok until I use -resize option, then I get image with black background. I use this command:

convert -density 400 image.pdf -resize 25% image.png

I need to use -resize option otherwise I get really large image. Is there any other option which I can use to resize image or is there option to set background in white.

Était-ce utile?

La solution 2

Solved it by removing alpha from image, it seems imagemagic tries to apply some opacity but since jpeg doesn't allow transperency result was black background. So I found example on imagemagic website and it helped me:

convert a.pdf   -background skyblue  -alpha remove -alpha off a_remove.jpg

Autres conseils

That's not a Ghostscript command, You will need to find out what convert is sending to Ghostscript. As it stands I can't even be sure that your problem is with Ghostscript ,since it could easily be something that convert is doing.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top