How to adjust the resolution keeping the print size?
Posted: 2015-08-14T07:18:51-07:00
Hello. This is my first post. I am a new user ImageMagick.
I'm trying to use ImageMagick to convert a PDF file to PNG format. This PDF file is generated from PSTricks. Basically, within the PDF file there is only a vector image in PostScript (which is what generates PSTricks) with a certain size.
The problem occurs when I try to specify the resolution and size for printing the image. I need the PNG image keep the dimensions specified in the design with PSTricks.
Check if my reasoning is correct: I have a file "in.pdf" which has dimensions of 4.1cm x 4.1cm, which means 1.6in x 1.6in. How I wish a resolution of 600dpi, the image size should be 600 * 1.6 = 960 px.
Then, the command should be (using sh in Linux):
However, something goes wrong in my calculation, because the output of the command identy shows the following:
But when I copy the image to the LibreOffice Writer, the image appears too big. LibreOffice can not recognize the expected size of the image that was just 4.1cm x 4.1cm (LibreOffice shows a much higher real size: 21 x 25.64cm).
When you open the image with Gimp, by accessing the image menu -> size for printing, it is shown that the image is 341.84mm x 341.84mm with, or approximately 13.4 in x 13.4 in ... at a resolution of 72 dpi.
If I adjust the size for printing in Gimp to 1.6in, automatically the resolution up to 600dpi, apparently without changing the image. And when I copy this modified version of LibreOffice, it does so with the expected size.
What is going on? How to adjust the resolution with ImageMagick keeping the print size? What are the errors in my procedure?
Thank you in advance.
Note:
Version: ImageMagick 6.8.9-9 Q16 x86_64 2015-01-06.
Kubuntu 15.05 64 bits.
Commando Line Linux (sh).
I'm trying to use ImageMagick to convert a PDF file to PNG format. This PDF file is generated from PSTricks. Basically, within the PDF file there is only a vector image in PostScript (which is what generates PSTricks) with a certain size.
The problem occurs when I try to specify the resolution and size for printing the image. I need the PNG image keep the dimensions specified in the design with PSTricks.
Check if my reasoning is correct: I have a file "in.pdf" which has dimensions of 4.1cm x 4.1cm, which means 1.6in x 1.6in. How I wish a resolution of 600dpi, the image size should be 600 * 1.6 = 960 px.
Then, the command should be (using sh in Linux):
Code: Select all
convert -density 600 -size 960 in.pdf out.png
Code: Select all
Geometry: 967x967+0+0
Resolution: 600x600
Print size: 1.61167x1.61167
When you open the image with Gimp, by accessing the image menu -> size for printing, it is shown that the image is 341.84mm x 341.84mm with, or approximately 13.4 in x 13.4 in ... at a resolution of 72 dpi.
If I adjust the size for printing in Gimp to 1.6in, automatically the resolution up to 600dpi, apparently without changing the image. And when I copy this modified version of LibreOffice, it does so with the expected size.
What is going on? How to adjust the resolution with ImageMagick keeping the print size? What are the errors in my procedure?
Thank you in advance.
Note:
Version: ImageMagick 6.8.9-9 Q16 x86_64 2015-01-06.
Kubuntu 15.05 64 bits.
Commando Line Linux (sh).