Page 1 of 1

Low resolution when converting small PDF to png

Posted: 2012-12-11T03:12:50-07:00
by dala
I have a small PDF file which is defined as being 47 points wide by 48 points high.
When I use imagemagic to convert this file to a png I am not able to get the resolution any higher than 47px x 48px.
In other words, if I make a png which is 200 px high, the resolution is very bad.
I have tried using the -density option, but it doesen't help.

The pdf is a vectorfile, its not just an image put into a pdf, so I can scale it as much as I like, but I don't know how to do this using imagemagic.
It seems like imagemagic by default will max 1 pixel per point. How can I fix this?

In other words, how can I make a tiny vectorfile come out as a large high resolution image?

Re: Low resolution when converting small PDF to png

Posted: 2012-12-11T11:43:47-07:00
by fmw42
I am not sure about conversions between points and pixels. However, to get better quality the -density must be put before the pdf and you can use supersampling to increase the quality.

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

default density is 72, so 72*4=288 and then resize by 1/4=25%

You can increase the density as much as you want and change the resize to the output pixel size as desired.

If I misunderstand your issue, then please explain in more detail and perhaps provide links to example input and output. Also provide your command line and version of IM and platform.

Re: Low resolution when converting small PDF to png

Posted: 2012-12-12T05:56:33-07:00
by dala
>However, to get better quality the -density must be put before the pdf...

Thanks, that worked!
I had allready tried the -density parameter but I had put it AFTER the input file;I didn't know that it would make a difference.
Putting it IN FRONT of the input file did the trick!

Re: Low resolution when converting small PDF to png

Posted: 2012-12-12T11:06:16-07:00
by fmw42
dala wrote:>However, to get better quality the -density must be put before the pdf...

Thanks, that worked!
I had allready tried the -density parameter but I had put it AFTER the input file;I didn't know that it would make a difference.
Putting it IN FRONT of the input file did the trick!

A number of settings, like density, need to be put before reading vector files because they have no intrinsic size. Otherwise for raster files, they should following the input.