PDF to PNG conversion

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
ac3raven
Posts: 1
Joined: 2012-11-26T13:32:07-07:00
Authentication code: 6789

PDF to PNG conversion

Post by ac3raven »

When I use the PrtSc key to take a screenshot of a pdf page and then I paste it into Gimp, it looks good. But when I use IM to extract a page and save it as a png, it looks bad, as though all the antialiasing is gone and everything is smaller and more difficult to read.

I'm trying to use IM to replicate the result I get from PrtSc because I need IM for some batch processing. I'm new to IM, by the way. I have a feeling it has something to do with PDF being a vector format and IMs limitations when it comes to converting vector to bitmap.

I'm just using the regular -convert command to do this. Help?

What I need from IM:
Image

What I'm getting:
Image
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: PDF to PNG conversion

Post by fmw42 »

Use supersampling:

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

normal density is 72. So 72*4=288 enlarges the pdf and then resize by 1/4=25% to get back to normal size. It will take longer but the quality will be much better.
Post Reply