Page 1 of 1
Density question
Posted: 2010-02-22T01:27:26-07:00
by mde
Newbie question...
I'm convert-ing a PNG at 1280x720px into PDF. By default, the generated PDF comes out at ~50% larger than the original PNG.
Code: Select all
$ convert foo.png foo.pdf && acroread foo.pdf # oops, too big by 50%
$ convert -density 110 foo.png foo.pdf && acroread foo.pdf # via eyeball check looks pretty close to orig PNG size
Now I'm starting to make wild guesses about DPI (72?) and adding 50% to make it 108, which is pretty close to my guess-and-check density magic number. I'd like to understand (at least a little): (1) why I need to specify "-density 110", and (2) if that's really the right number. Thanks!
Re: Density question
Posted: 2010-02-22T01:52:48-07:00
by snibgo
I suspect you are comparing apples with oranges, "judging by eye".
What is the density of your png file?
You might get something like:
Geometry: 1280x720+0+0
Resolution: 72x72
Print size: 17.77x10.00
Units: PixelsPerInch
Then I would expect
to create a document 17.77 inches by 10 inches.
Re: Density question
Posted: 2010-02-22T02:24:53-07:00
by mde
Thanks!
$ identify foo.png
foo.png PNG 1280x720 1280x720+0+0 8-bit DirectClass 403KiB 0.060u 0:00.070
$ convert foo.png foo-big.pdf && identify foo-big.pdf
foo-big.pdf PDF 1280x720 1280x720+0+0 16-bit Bilevel DirectClass 113KiB 0.010u 0:00.010
$ convert -density 100 foo.png foo-small.pdf && identify foo-small.pdf
foo-small.pdf PDF 922x518 922x518+0+0 16-bit Bilevel DirectClass 58.7KiB 0.010u 0:00.000
So acroreader seems to just be throwing me off. I've made sure to set its zoom level to 100% and indeed the "big" PDF looks 50% oversized (as compared to my PNG viewer at 100%, eog). But I'll presume that "identify" is telling the truth here -- that it's really maintaining the 1280x720. The big and small PDFs are the same file size. So I don't understand why the viewers don't agree, but maybe I don't need to worry about it.
FYI, this PDF is to be uploaded to SlideShare.com and I'm wanting the resolution to be at a standard size. I'm going to trust "identify" for now, and go with the default density.
Re: Density question
Posted: 2010-02-22T03:14:26-07:00
by snibgo
Image viewers may not use the same assumed DPI for your screen.
You might use the "-verbose" option of identify to get the density, and hence the physical dimensions.
Then "acroread foo.pdf", File, Properties, Description will tell you if the physical dimensions are the same.