To identify format and characteristics of image file you need to use command called identify.
It will also report if an image is incomplete or corrupt. The information displayed includes the scene number, the file name, the width and height of the image, whether the image is colormapped or not, the number of colors in the image, the number of bytes in the image, the format of the image (JPEG, PNM, etc.), and finally the number of seconds it took to read and process the image
If you are looking to provide scripting solution to automate task then this command is the best one.
$ identify -verbose snap-S25-20060218-235000-1.ppm | less
Output:
Image: snap-S25-20060218-235000-1.ppm
Format: PNM (Portable anymap)
Geometry: 768x576
Class: DirectClass
Colorspace: RGB
Type: TrueColor
Depth: 8 bits
Endianess: Undefined
Channel depth:
Red: 8-bits
Green: 8-bits
Blue: 8-bits
Channel statistics:
Red:
Min: 0
Max: 255
Mean: 87.5478
Standard deviation: 89.9707
Green:
Min: 0
Max: 255
Mean: 73.0576
Standard deviation: 84.7219
Blue:
Min: 0
Max: 255
Mean: 53.6681
Standard deviation: 73.7701
Colors: 163423
Rendering-intent: Undefined
Resolution: 72x72
Units: Undefined
Filesize: 1.3mb
Interlace: None
Background Color: grey100
Border Color: #DFDFDF
Matte Color: grey74
Dispose: Undefined
Iterations: 0
Compression: Undefined
Orientation: Undefined
signature: ad1ac5b547203e393117aab
Tainted: False
User Time: 0.020u
Elapsed Time: 0:01 You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop













{ 1 comment… read it below or add one }
The identify command is part of the ImageMagick software package.
If you don’t have it installed on your system, you won’t be able to run identify….
Directions to install ImageMagick are available at http://imagemagick.org/script/binary-releases.php