Get useful image information on the command line
ImageMagick is an incredible set of programs that allow you to get all sorts of information on image files from the command line, as well as batch edit and generally alter images of many varieties. You can read all about these facilities on ImageMagick’s well-made documentation site.
What I often want, however, is simple: a command to get commonly desired information from any image file. Alias to the rescue!
1 | alias imginfo="identify -format '-- %f -- \nType: %m\nSize: %b bytes\nResolution: %wpx x %hpx\nColors: %k'" |
This produces a succinctly helpful output:

Often this is all I need for basic tasks. And if more is needed there’s always the full ImageMagick suite.
You can alter the format to whatever you prefer, using the wide variety of variables.
Possibly Related (no promises):
- Easily sum matching file line counts
- Exploring the power of the mysql client
- Useful ways to list directory contents
- More efficient HTML editing in vim
- Viewing all users on a Linux system
Related posts brought to you by Yet Another Related Posts Plugin.
September 26, 2009 - 10:20 PM







