Convert with density and resample arguments does not change DPI

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
blumbergrotem
Posts: 1
Joined: 2019-09-28T02:11:07-07:00
Authentication code: 1152

Convert with density and resample arguments does not change DPI

Post by blumbergrotem »

Hello, Colleagues,
I am trying to convert a pdf to a 300 DPI image, I specify the arguments:
-units PixelsPerInch -density 300 (also tried -units PixelsPerInch -resample 300)

But when checking DPI using identity I get 72 DPI.

Here is the convert command:

"& 'PathToIMageMagickFolder\magick.exe' convert 'PathToFolderContainingFile\fileName.pdf' -units PixelsPerInch -density 300 'PathToFolderForExportedImage\fileName.pdf'"

Than I run the identity DPI check:
"& 'PathToIMageMagickFolder \magick.exe' identify -quiet -format "%x x %y" 'PathToFolderForExportedImage\fileName.pdf'"

And get:
72 x 72 - 72 x 72 - [DBG] (by the way why does it appear twice with DBG? I did not specify any debug parameter)

I also tried with -resample with the same result.

Your help is highly appreciated,
Rotem
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Convert with density and resample arguments does not change DPI

Post by snibgo »

"-format" is done once per image, so I suppose your PDF has two pages.

PDF pages are vector, so they don't really have any resolution. However they do have a physical size in inches or whatever, so setting a density for a PDF affects this size.
snibgo's IM pages: im.snibgo.com
Post Reply