Sven Köhler
2011-02-10 11:51:38 UTC
Hi,
first, here's what I'm not looking for:
convert [-density XYZ] some.pdf -resize 250x250 some.png
This is "suboptimal" because the PDF is rendered at some density chosen
by imagemagick (or at the give one, which some people on the net just
seem to chose randomly), and then scaled to the right pixel size
afterwards. In particular, this gives bad looking results if the PDF
contains very thin lines (which tend to disappear when you scale down to
250x250 from large pixel images) or if you want to render the PDF at a
very high resolution (in which case imagemagick internally scales up a
pixel image rendered at the ).
It would be much cleverer, to render the PDF at the right density which
yields an image with the desired pixel size. Manually, I figured out
that the desired density should be 56.8. So I used:
convert -density 56.8x56.8 some.pdf some.png
However, it kind of sucks that you have to perform a manual computation
before rendering a PDF. Does imagemagick have a better way of doing
this, in particular without a manual compuation? Can I render a PDF at a
given pixel size, instead of a given density?
Some googling revealed nothing.
Regards,
Sven
first, here's what I'm not looking for:
convert [-density XYZ] some.pdf -resize 250x250 some.png
This is "suboptimal" because the PDF is rendered at some density chosen
by imagemagick (or at the give one, which some people on the net just
seem to chose randomly), and then scaled to the right pixel size
afterwards. In particular, this gives bad looking results if the PDF
contains very thin lines (which tend to disappear when you scale down to
250x250 from large pixel images) or if you want to render the PDF at a
very high resolution (in which case imagemagick internally scales up a
pixel image rendered at the ).
It would be much cleverer, to render the PDF at the right density which
yields an image with the desired pixel size. Manually, I figured out
that the desired density should be 56.8. So I used:
convert -density 56.8x56.8 some.pdf some.png
However, it kind of sucks that you have to perform a manual computation
before rendering a PDF. Does imagemagick have a better way of doing
this, in particular without a manual compuation? Can I render a PDF at a
given pixel size, instead of a given density?
Some googling revealed nothing.
Regards,
Sven