How to fit an image in a pdf page without increase weight?
Posted: 2010-10-22T03:39:36-07:00
Hello,
In Gimp, it's possible to print (and thus exporting to PDF via a virtual printer) a small image and to fit it at the maximal size allowed but without increasing the number of pixels in the image. Eg I've an image of 180x180pixels here:
http://www.k1ka.be/pub/200px-Circle_-_b ... le.svg.png
In gimp, the printing dialog gives 72 dpi and a size of 63.5mm; I've adjusted the dpi to 24 and the image becomes 190.5mm of width.
The resulting pdf is here:
http://www.k1ka.be/pub/200px-Circle_-_b ... le_svg.pdf
As you can see, the weight of the PDF file is very close to this of the the bitmap one (5689 vs. 9513 bytes).
How to do the same with Image Magick ? When I try with or without the -page option, the result is the same:
and the image is not "scaled". Printed on a sheet of paper, the image is positionned at the bottom corner, and at a size around 63mm.
Has someone a proposition ?
Thanls in advance,
G.
In Gimp, it's possible to print (and thus exporting to PDF via a virtual printer) a small image and to fit it at the maximal size allowed but without increasing the number of pixels in the image. Eg I've an image of 180x180pixels here:
http://www.k1ka.be/pub/200px-Circle_-_b ... le.svg.png
In gimp, the printing dialog gives 72 dpi and a size of 63.5mm; I've adjusted the dpi to 24 and the image becomes 190.5mm of width.
The resulting pdf is here:
http://www.k1ka.be/pub/200px-Circle_-_b ... le_svg.pdf
As you can see, the weight of the PDF file is very close to this of the the bitmap one (5689 vs. 9513 bytes).
How to do the same with Image Magick ? When I try with or without the -page option, the result is the same:
Code: Select all
gv@fantasio:~$ convert 200px-Circle_-_black_simple.svg.png test.pdf
gv@fantasio:~$ ls -l test.pdf
-rw-r--r-- 1 gv gv 6277 oct 22 12:31 test.pdf
gv@fantasio:~$ convert -page A4 200px-Circle_-_black_simple.svg.png test.pdf
gv@fantasio:~$ ls -l test.pdf
-rw-r--r-- 1 gv gv 6277 oct 22 12:31 test.pdf
Has someone a proposition ?
Thanls in advance,
G.