Hi
If I use a "identify -verbose img.png" I get:
...
Geometry: 3553x748+0+0
Resolution: 190x190
Print size: 18.7x3.93684
Units: PixelsPerInch
...
but if I use
identify -format "%x" img.png
I get:
74.8 PixelsPerCentimeter
What do I have to place after "-format" do get the "190" instead of the "74.8" ?
Greeting
Roland
dpi or dots per centimeter
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: dpi or dots per centimeter
As far as I know PNG only supports pixelspercentimeter. see http://www.imagemagick.org/Usage/formats/#png_density
So I am surprised you get units of pixels per inch in the verbose info. I suspect IM convert the pixels per inch to the equivalent pixels per cm when showing %x. 74.8*2.54=190.
I suspect that your png image is not correctly created if it shows pixels per inch in the verbose info.
However, this will convert to pixelsperinch for showing units and density.
convert image.png -units pixelsperinch -format "%x" info:
So I am surprised you get units of pixels per inch in the verbose info. I suspect IM convert the pixels per inch to the equivalent pixels per cm when showing %x. 74.8*2.54=190.
I suspect that your png image is not correctly created if it shows pixels per inch in the verbose info.
However, this will convert to pixelsperinch for showing units and density.
convert image.png -units pixelsperinch -format "%x" info: