In the General section of that window you see the ‘size’ of the image in Kilobytes (or maybe Megabytes), eg 176 Kb. In the More Info section of the Get Info window you see the image Dimensions in pixels, eg 1000 * 750.
Control click on an image, such as a photo, in the Finder. The Get Info window appears.
Now select several images and you have a problem. To discover the dimensions you must look at a Get Info window for each image. That works for one or two, but not for dozens or hundreds.
And what if you want to note down those dimensions? You could be in for a huge amount of very tedious work, unless you buy software to handle the task for you.
Or you could quickly and easily get your Mac to do that work for free using the scriptable image processing system, otherwise known as sips.
Use the Terminal to get image dimensions
- Open the Terminal (it’s in Applications > Utilities). A Terminal window appears.
cd(that’s cd followed by a space), then
- drag in the folder containing the images whose dimensions you want to know. The file path is added at the end of the line.
- Press Return. The Terminal now knows to look in the right place for the images you’re getting information about.
- Type in the following (watch the spaces):
sips -g pixelHeight -g pixelWidth *
- Press Return. A list of image dimensions is output to the Terminal window.
[Based on information in: macosxhints.com – Get the dimensions of most images from the command line.]
Save the list to a file
To save the information out to a file redirect the output. Replace Step 5 with the following:
sips -g pixelHeight -g pixelWidth * > dimensions.txt
Now the dimensions will be saved to a file called
dimensions.txt, saved in the same folder as the images are in.
Listings look like this example:
/Users/miraz/Dropbox/Photos/paddy-the-wanderer/paddy-wanderer-0257.jpg pixelHeight: 800 pixelWidth: 600
If you’re a web developer you could now open that file in a text editor and use some scripts to create any HTML coding you require.
When I tried this on a folder of around 1,200 photos on a network drive it was less than a minute before that text file was created. It listed file path, file name, width and height for all 1,200 photos.
Other articles that might interest you
- Do your images drive people away?
- The skinny on images in web pages and email
- Resize images with Automator
- A Historic Terminal
- List Applications and More
Did you try this out? How did it work for you? Let us know in the comments.