vector to png

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
Jack

vector to png

Post 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?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: vector to png

Post by magick »

Try the -density option, for example,
  • convert -density 100 image.pdf image.png
Jack

Re: vector to png

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: vector to png

Post by magick »

That would work. Super-sample the image with the -density option then resize to your absolute dimensions with -resize.
Jack

Re: vector to png

Post by Jack »

ok, thanks for your help!
Post Reply