pdf2png

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
crealing

pdf2png

Post by crealing »

i got a trouble when i converted pdf to png. if the pdf have transparency layer, the generating png is very bad, and the transparency area show black box. can anybody tell me how to resolve it.

php codes i used as following:
1.exec('convert input.pdf out.png');
2.exec('convert -resample 72 -thumbnail 300 input.pdf out.png);
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: pdf2png

Post by fmw42 »

I am not sure I know how to help with transparency. As I recall that issue came up recently and was fixed. So if you are on an old version of IM, the best thing would be to upgrade.

With regard to quality, the best thing is to supersample

convert -density 288 input.pdf -resize 25% output.png

or

convert -density 288 input.pdf -thumbnail 25% output.png

Note 288=4*72 where 72 is the nominal dpi

So you would be reading in the pdf at 4x resolution and using -resize to downsample by 4x
Post Reply