Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Say I import a TIFF, JPEG, or PDF image. How can I quickly determine the original aspect ratio of the image so that I can properly scale its size? I have thus far been unable to find an answer looking through the manual.

share|improve this question
ImageAspectRatio or ImageDimensions should do the trick. – cormullion Mar 24 '13 at 14:41
up vote 4 down vote accepted

ImageDimensions will give you the pixel dimensions of an imported image, from which can calculate the aspect ratio:

img = Import[""];

enter image description here

{858, 705}
share|improve this answer
And ImageAspectRatio in versions 8 and 9... :) – cormullion Mar 24 '13 at 14:43

If you want to know the aspect ration of the image without importing the image itself, you can use "ImageSize" as last parameter to Import

N[Divide @@ Reverse@
  Import["", "ImageSize"]]

which gives the same value of 0.821678 as

ImageAspectRatio[Import[""]] // N
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.