Page 1 of 1

Converting pdf to high quality png

Posted: 2013-06-01T02:57:37-07:00
by Igor
Hello there!
I must say that I'm a complete newbie to imagemagick and it may be the reason why I'm struggling to figure out how to convert my high quality pdf file to png file preferably of the same quality as the source file (by the way I tried reading the manual but there're some things that I still don't clearly understand)
I guess it's not possible since pdf files use a combination of vector and raster images while it's not the case with png files. But I'd like to make the quality of my png file as good as possible and I would very appreciate any help that you can provide on how to do this using this truly wonderful program ,imagemagick. :D

P.S. Yeah I tried something like this:

Code: Select all

convert -resize 842x596 Pr_mt.pdf Pr_mt.png
But it yields a file with quite low quality .

Re: Converting pdf to high quality png

Posted: 2013-06-01T03:19:19-07:00
by snibgo
For this, you almost certainly need "-density".

Vector images in PDF have no perfect setting for density. In general, higher numbers give higher quality.

Raster images in PDF work best when "-density" is an integer multiple (or fraction) of the original. For example, if the original is 300 dpi (dots per inch), density should be 300, 600 or 150.

Ideally, we would have a program that could read a PDF file, examine all the images, tell us the density of each, and recommend a reasonable density setting. Sadly, I don't know of such a program.

For PDF files that contain scanned pages, I use Adobe Reader to find the resolution. For modern scanners, this always seems to be a multiple of 150 dpi.

Re: Converting pdf to high quality png

Posted: 2013-06-01T06:12:16-07:00
by Igor
Hello Snibgo.
Hmm seems so...I've just play around a bit with -density and seems like I've found what had been looking for. Thank you. Though there's also such thing as -quality , need to know what it does, I guess I need to do more browsing to figure this out hehe

Re: Converting pdf to high quality png

Posted: 2013-06-01T06:59:05-07:00
by snibgo
"-quality" refers to the data loss when saving files, especially in JPG format. It is just a number that happens to be between 0 and 100, not a percentage.

Good places to start learning about IM:
http://www.imagemagick.org/script/comma ... ptions.php
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/

IM is a great system, but complex. Feel free to ask.