Hi all
I have a PDF file containing one picture (which is very vectorial : it was produced by laTeX/pstrcicks). I'd like to have a PNG from it.
First try :
convert MyImage.pdf MyImage.png
Problem : the image is too small (smaller than the original pdf) and then got ugly when resized.
Second try :
convert MyImage.pdf -resize 200% MyImage.png
Problem : the exit has not the expected quality.
Since PDF is vectorial, it is possible to produce a correct PNG image of arbitrary size, no ?
In fact I can open the PDF in Gimp and ask Gimp to convert the PDF into a 300% image. Gimp takes the vectorial information into account
and exports a big and beautiful PNG picture.
What I would like to do is to convert a PDF into a PNG and impose the size of the png picture without lose of quality.
I hope I've been clear in my explanation. Any help is welcome !
thanks
Laurent
Convert PDF -> PNG with the right size
Re: Convert PDF -> PNG with the right size
Try this command:
- convert -density 400 MyImage.pdf -resize 25% MyImage.png
Re: Convert PDF -> PNG with the right size
That makes the work even with -resize 300% !convert -density 400 MyImage.pdf -resize 25% MyImage.png
Thanks
It is possible to impose the size of the new picture in centimeters instead of pixels or proportion ? I didn't saw that on the page dedicated to resize
My point is that the picture is created by LaTeX-pstricks and that I know the so-called boundingbox that is given in
centimeters (xsize x ysize).
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Convert PDF -> PNG with the right size
try adding -units pixelspercentimeter
my nominal computation is 72dpi*4=288 so
convert -density 288 MyImage.pdf -resize 25% MyImage.png
so try
72dpi=72/2.54=28dpc
28*4=112
convert -units pixelspercentimeter -density 112 MyImage.pdf -resize 25% MyImage.png
But you can make the density larger and get a bigger resulting png
my nominal computation is 72dpi*4=288 so
convert -density 288 MyImage.pdf -resize 25% MyImage.png
so try
72dpi=72/2.54=28dpc
28*4=112
convert -units pixelspercentimeter -density 112 MyImage.pdf -resize 25% MyImage.png
But you can make the density larger and get a bigger resulting png