How many pixels my image has like resolution?

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
poincare999

How many pixels my image has like resolution?

Post by poincare999 »

Hi
I have an image: image.jpg.
I want know how many pixels it has.
What commad must I use?

For instance, If "image.jpg" has the resolution of 1536x2048 pixels, I want a command tells me that the resolution of "image.jpeg" is 1536x2048 pixels.

Thanks.
defied

Re: How many pixels my image has like resolution?

Post by defied »

Code: Select all

identify -format "%wx%h" picture.jpg
or in php

Code: Select all

exec('identify -format "%wx%h" picture.jpg', $a); print_r($a);
poincare999

Re: How many pixels my image has like resolution?

Post by poincare999 »

Great!!

Thank you very much.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: How many pixels my image has like resolution?

Post by anthony »

Note that is not however the images resolution, but it's size. Resolution is expressed as points or dots per real-world mesaure. For example dpi, Dots Pre Inch.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply