Image Format and Characteristics

Example UsageOption Summary

The identify program describes the format and characteristics of one or more image files. It also reports if an image is incomplete or corrupt. The information returned includes the image 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. Many more attributes are available with the verbose option. See Command Line Processing for advice on how to structure your identify command or see below for example usages of the command.

Example Usage

We list a few examples of the identify command here to illustrate its usefulness and ease of use. To get started, lets identify an image in the JPEG format:

-> identify rose.jpg
rose.jpg JPEG 70x46 70x46+0+0 8-bit sRGB 2.36KB 0.000u 0:00.000

By default, identify provides the following output: 

    Filename[frame #] image-format widthxheight page-widthxpage-height+x-offset+y-offset colorspace user-time elapsed-time

Next, we look at the same image in greater detail:

-> identify -verbose rose.jpg
Image: rose.jpg
  Format: JPEG (Joint Photographic Experts Group JFIF format)
  Mime type: image/jpeg
  Class: DirectClass
  Geometry: 70x46+0+0
  Units: Undefined
  Type: TrueColor
  Endianess: Undefined
  Colorspace: sRGB
  Depth: 8-bit
  Channel depth:
    red: 8-bit
    green: 8-bit
    blue: 8-bit
  Channel statistics:
    Pixels: 3220
    Red:
      min: 35 (0.137255)
      max: 255 (1)
      mean: 145.57 (0.570865)
      standard deviation: 67.2976 (0.263912)
      kurtosis: -1.37971
      skewness: 0.0942169
      entropy: 0.974889
    Green:
      min: 33 (0.129412)
      max: 255 (1)
      mean: 89.2193 (0.349879)
      standard deviation: 52.0803 (0.204236)
      kurtosis: 2.70722
      skewness: 1.82562
      entropy: 0.877139
    Blue:
      min: 11 (0.0431373)
      max: 255 (1)
      mean: 80.3742 (0.315193)
      standard deviation: 53.8536 (0.21119)
      kurtosis: 2.90978
      skewness: 1.92617
      entropy: 0.866692
  Image statistics:
    Overall:
      min: 11 (0.0431373)
      max: 255 (1)
      mean: 105.055 (0.411979)
      standard deviation: 58.1422 (0.228008)
      kurtosis: 1.25759
      skewness: 1.4277
      entropy: 0.90624
  Rendering intent: Perceptual
  Gamma: 0.454545
  Chromaticity:
    red primary: (0.64,0.33,0.03)
    green primary: (0.3,0.6,0.1)
    blue primary: (0.15,0.06,0.79)
    white point: (0.3127,0.329,0.3583)
  Background color: white
  Border color: srgb(223,223,223)
  Matte color: grey74
  Transparent color: black
  Interlace: None
  Intensity: Undefined
  Compose: Over
  Page geometry: 70x46+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: JPEG
  Quality: 92
  Orientation: Undefined
  Properties:
    date:create: 2014-11-09T09:00:35-05:00
    date:modify: 2014-11-09T09:00:35-05:00
    jpeg:colorspace: 2
    jpeg:sampling-factor: 2x2,1x1,1x1
    signature: 22a99838bd5594250f706d1d9383b2830f439fcbaf1455cbe2f7f59a4deb065a
  Artifacts:
    filename: rose.jpg
    verbose: true
  Tainted: False
  Filesize: 2.36KB
  Number pixels: 3.22K
  Pixels per second: 3.22EB
  User time: 0.000u
  Elapsed time: 0:01.000
  Version: ImageMagick Q16 https://imagemagick.org

Note, the image signature is generated from the pixel components, not the ima ge metadata.

To get the print size in inches of an image at 72 DPI, use:

-> identify -format "%[fx:w/72] by %[fx:h/72] inches" document.png
8.5 x 11 inches

The depth and dimensions of a raw image must be specified on the command line:

-> identify -depth 8 -size 640x480 image.raw
image.raw RGB 640x480 sRGB 9kb 0.000u 0:01

Here we display the image texture features, moments, perceptual hash, and the number of unique colors in the image:

-> identify -verbose -features 1 -moments -unique image.png

Here is a special define that outputs the location of the minimum or maximum pixel of the image:

identify -precision 5 -define identify:locate=maximum -define identify:limit=3 image.png

You can find additional examples of using identify in Examples of ImageMagick Usage.

Option Summary

The identify command recognizes these options. Click on an option to get more details about how that option works.

OptionDescription
-alphaon, activate, off, deactivate, set, opaque, copy", transparent, extract, background, or shape the alpha channel
-antialiasremove pixel-aliasing
-authenticate valuedecrypt image with this password
-auto-orientautomagically orient image
-channel typeapply option to select image channels
-clipclip along the first path from the 8BIM profile
-clip-mask filenameassociate clip mask with the image
-clip-path idclip along a named path from the 8BIM profile
-colorspace typeset image colorspace
-crop geometrycrop the image
-debug eventsdisplay copious debugging information
-define format:optiondefine one or more image format options
-density geometryhorizontal and vertical density of the image
-depth valueimage depth
-endian typeendianness (MSB or LSB) of the image
-extract geometryextract area from image
-features distanceanalyze image features (e.g. contract, correlations, etc.).
-format stringoutput formatted image characteristics
-gamma valuelevel of gamma correction
-grayscale methodconvert image to grayscale
-helpprint program options
-interlace typetype of image interlacing scheme
-interpolate methodpixel color interpolation method
-limit type valuepixel cache resource limit
-list typeColor, Configure, Delegate, Format, Magic, Module, Resource, or Type
-log formatformat of debugging information
-mask filenameassociate a mask with the image
-momentsdisplay image moments and perceptual hash.
-monitormonitor progress
-negatereplace each pixel with its complementary color
-pingby default, efficiently determine certain image characteristics by only reading the requisite image metadata. To accurately identify all the image metadata and pixel characteristics, use +ping.
-precision valueset the maximum number of significant digits to be printed
-quietsuppress all warning messages
-regard-warningspay attention to warning messages.
-respect-parenthesessettings remain in effect until parenthesis boundary.
-sampling-factor geometryhorizontal and vertical sampling factor
-set attribute valueset an image attribute
-size geometrywidth and height of image
-stripstrip image of all profiles and comments
-uniquedisplay image the number of unique colors in the image.
-units typethe units of image resolution
-verboseprint detailed information about the image
-versionprint version information
-virtual-pixel methodaccess method for pixels outside the boundaries of the image
About ImageMagick