trouble converting PNG to PDF

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
dowcet
Posts: 11
Joined: 2015-04-03T23:51:15-07:00
Authentication code: 6789

trouble converting PNG to PDF

Post by dowcet »

Here is an example image. Call it input.png.

Here is the result I get from "convert input.png output.pdf".

Depending on the PDF viewer I use, the resulting PDF is either a) blank or b) displays at an extremely high resolution, so that I have to zoom to less then 1% to read it. Setting "density" or resizing don't seem to matter. Any ideas?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: trouble converting PNG to PDF

Post by snibgo »

"identify verbose" reports your png file has a resolution of 0.15 pixels per centimetre, so the total image is 80 metres wide and 115 metres tall.

Try changing it to a more sensible "-density" before conversion to pdf.

Code: Select all

convert WVuCk3x.png -density 100 -units pixelsperinch x.pdf
snibgo's IM pages: im.snibgo.com
dowcet
Posts: 11
Joined: 2015-04-03T23:51:15-07:00
Authentication code: 6789

Re: trouble converting PNG to PDF

Post by dowcet »

I see, thanks... Is there some kind of tutorial out there to help me understand what a sensible density setting is for a given image?

"identify verbose input.png" gives me a ton of output. "identify -verbose input.png | grep -i 'resolution'" gives me "Resolution: 0.15x0.15" but I have no idea what that means.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: trouble converting PNG to PDF

Post by snibgo »

Identify -verbose says, near the top:

Code: Select all

  Geometry: 1200x1721+0+0
  Resolution: 0.15x0.15
  Print size: 8000x11473.3
  Units: PixelsPerCentimeter
A resolution of 0.15 PixelsPerCentimeter (which is 0.381 pixels per inch) means that each pixel is nearly 6 centimetres across, or 2.6 inches. So the 1200 pixels across the width of the image take 8000cm, or 80 metres, which is more than 240 feet. Some people want prints this massive, but most of us don't.

Computer screens are around 100 dots per inch (dpi). Home/office printers are often 600 dpi.

Most digital images have a sensible density setting, or none at all in which case software assumes a number like 72 dpi or 90 dpi.
snibgo's IM pages: im.snibgo.com
dowcet
Posts: 11
Joined: 2015-04-03T23:51:15-07:00
Authentication code: 6789

Re: trouble converting PNG to PDF

Post by dowcet »

That helps a lot... thank you, snibgo!
Post Reply