Page 1 of 1

vector to png

Posted: 2009-05-04T15:58:04-07:00
by Jack
Hi guys

I'm just getting started with imagemagick so please bear with me : ]

I've been trying to convert a vector pdf into a png. The width of the png should be exactly 900 pixels.

this is the command I tried, however the png is always around 200 pixels (the size the pdf was encoded at):

Code: Select all

convert -size 900 test.pdf test.png
I also tried -resize, but that resized the png file instead of the pdf, introducing scaling artifacts.

what am I doing wrong?

Re: vector to png

Posted: 2009-05-04T16:26:09-07:00
by magick
Try the -density option, for example,
  • convert -density 100 image.pdf image.png

Re: vector to png

Posted: 2009-05-04T17:25:18-07:00
by Jack
so there's no way to specify an absolute pixel amount for the output?

I guess I'll have to create a really big png using the density option, and then downsample it to the absolute size I need. Is that correct?

thanks

Re: vector to png

Posted: 2009-05-04T17:55:07-07:00
by magick
That would work. Super-sample the image with the -density option then resize to your absolute dimensions with -resize.

Re: vector to png

Posted: 2009-05-04T18:11:02-07:00
by Jack
ok, thanks for your help!