Linux

Categorized | Multimedia, cli

View Image File Metadata From the Command Line

Did you know you can access all the information store in a JPG/PNG/GIF file from the command line? Install the ImageMagick package and do this:

identify -verbose image_file.jpg

The output will be something llike this:

Image: image_file.jpg
  Format: JPEG (Joint Photographic Experts Group JFIF format)
  Class: DirectClass
  Geometry: 640×480+0+0
  Type: TrueColor
  Endianess: Undefined
  Colorspace: RGB
  Depth: 8-bit
  Channel depth:
    Red: 8-bit
    Green: 8-bit
    Blue: 8-bit
  Channel statistics:
    Red:
      Min: 0 (0)
      Max: 255 (1)
      Mean: 115.959 (0.45474)
      Standard deviation: 76.5409 (0.30016)
    Green:
      Min: 0 (0)
      Max: 255 (1)
      Mean: 114.635 (0.449548)
      Standard deviation: 81.5852 (0.319942)
    Blue:
      Min: 0 (0)
      Max: 255 (1)
      Mean: 116.819 (0.458114)
      Standard deviation: 84.7587 (0.332387)
  Rendering intent: Undefined
  Units: PixelsPerInch
  Filesize: 62.5703kb
  Interlace: None
  Background color: white
  Border color: rgb(223,223,223)
  Matte color: grey74
  Transparent color: black
  Page geometry: 640×480+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: JPEG
  Quality: 90
  Orientation: Undefined
  Jpeg:colorspace: 2
  Jpeg:sampling-factor: 2×1,1×1,1×1
  Signature: 59dddedfad604ea3f369256c41ed3f42bf6150cf960d62409cfc8c6103b65e18
  Tainted: False
  Version: ImageMagick 6.3.7 08/21/08 Q16 http://www.imagemagick.org

You can use this to extract specific fields from image files and make scripts that sort your images according to quality, background color or image size.
Original tip here.

Author Profile

T4L ;

Other posts by T4L

Author's web site



Are you satisfied with this blog?
Why not subscribe our RSS Feed? you will always get the latest post.


2 Comments


  1. Good tip!!!!

    I was needing the info ^_^

    1

  2. You can also use jhead, and file to extract some more simple information although some of it may be repeated.

    2

1 Trackback(s)

  1. 06 12 2008 : View Image File Metadata From the Command Line | Linux-Trickz

Leave A Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>