Page 1 of 1

Why -size option on convert command doesn't work?

Posted: 2012-06-02T18:17:12-07:00
by Habsy
I want to keep the original size of my image just converting its format. The following command should work, shouldn't it?
convert PTS01.pdf PTS01.gif

It doesn't apply the way I wanted it to. My PTS01.pdf image was resized and I can barely read what is written on it. I tried then to use the command -size (since I know the size of my original image) combined with the quality command:
convert -quality 100 -size 500x350 PTS01.pdf PTS01.gif

Why it doesn't work at all?
Thanks!

Re: Why -size option on convert command doesn't work?

Posted: 2012-06-02T19:07:13-07:00
by fmw42
First, -size is a setting and does nothing by itself.

More importantly, PDF files have no resolution (density), because they are vector format. You need to assign a density before reading the PDF (nominally it would be 72 dpi). Plus to get better quality you need to "supersample", which means you have to make the pdf larger by using a larger density and then resize the result back down by the opposite ratio. That will make the processing slower but give you higher quality result.

try

convert -density 288 PTS01.pdf -resize 25% PTS01.gif

288=72*4
25%=100%/4

Re: Why -size option on convert command doesn't work?

Posted: 2012-06-02T19:29:02-07:00
by Habsy
Wonderful explanation! Thank you very much. :D