Get The Width And Height Of An Image With ImageMagick

April 2023

This is how I get the width and height of image files on the command line

Width:

identify -format "%w" image.jpg

Height:

identify -format "%h" image.jpg

Notes

  • These commands don't add a newline
  • To add a newline change them to %w\n and %h
end of line