Example UsageOption Summary

Themagick 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. SeeCommand Line Processing for advice on how to structure yourmagick identify command or see below for example usages of the command.

Example Usage

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

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

By default,magick 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:

$ magick identify -verbose rose.jpgImage: rose.jpg  Format: JPEG (Joint Photographic Experts Group JFIF format)  Mime type: image/jpeg  Class: DirectClass  Geometry: 70x46+0+0  Units: Undefined  Type: TrueColor  Endianness: Undefined  Colorspace: sRGB  Depth: 8-bit  Channel depth:    Red: 8-bit    Green: 8-bit    Blue: 8-bit  Channel statistics:    Pixels: 3220    Red:      min: 31 (0.121569)      max: 255 (1)      mean: 145.557 (0.570814)      standard deviation: 69.1933 (0.271346)      kurtosis: -1.38945      skewness: 0.138955      entropy: 0.970683    Green:      min: 27 (0.105882)      max: 255 (1)      mean: 89.246 (0.349984)      standard deviation: 52.4608 (0.205729)      kurtosis: 2.60139      skewness: 1.80708      entropy: 0.869711    Blue:      min: 21 (0.0823529)      max: 255 (1)      mean: 80.4196 (0.315371)      standard deviation: 54.9377 (0.215442)      kurtosis: 2.93417      skewness: 1.95544      entropy: 0.853176  Image statistics:    Overall:      min: 21 (0.0823529)      max: 255 (1)      mean: 105.074 (0.412056)      standard deviation: 58.8639 (0.230839)      kurtosis: 1.37788      skewness: 1.48073      entropy: 0.897856  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)  Alpha color: grey74  Background color: white  Border color: srgb(223,223,223)  Transparent color: none  Interlace: None  Intensity: Undefined  Compose: Over  Page geometry: 70x46+0+0  Dispose: Undefined  Iterations: 0  Compression: JPEG  Quality: 92  Orientation: Undefined  Properties:    jpeg:colorspace: 2    jpeg:sampling-factor: 1x1,1x1,1x1    signature: aea65c9b557d779d142f26d04abe7008bab50f1e9647faae20afdcc6c15140d5  Artifacts:    verbose: true  Tainted: False  Filesize: 2.65KB  Number pixels: 3.22K  User time: 0.000u  Elapsed time: 0:01.000  Version: ImageMagick 7.0.4-8 Q16 x86_64 http://imagemagick.org

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

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

$ magick identify -format "%[fx:w/72] by %[fx:h/72] inches" document.png8.5 x 11 inches

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

$ magick identify -depth 8 -size 640x480 image.rawimage.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:

$ magick identify -verbose -features 1 -moments -unique image.png

To display the convex hull and minimum bounding box attributes of the image, use:

magick identify -define identify:convex-hull=true image.png

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

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

You can find additional examples of usingmagick identify inExamples of ImageMagick Usage.

Option Summary

Themagick 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
-authenticatevaluedecrypt image with this password
-auto-orientautomagically orient image
-channeltypeapply option to select image channels
-clipclip along the first path from the 8BIM profile
-clip-maskfilenameassociate clip mask with the image
-clip-pathidclip along a named path from the 8BIM profile
-colorspacetypeset image colorspace
-cropgeometrycrop the image
-debugeventsdisplay copious debugging information
-defineformat:optiondefine one or more image format options
-densitygeometryhorizontal and vertical density of the image
-depthvalueimage depth
-endiantypeendianness (MSB or LSB) of the image
-extractgeometryextract area from image
-featuresdistanceanalyze image features (e.g. contract, correlations, etc.).
-formatstringoutput formatted image characteristics
-gammavaluelevel of gamma correction
-grayscalemethodconvert image to grayscale
-helpprint program options
-interlacetypetype of image interlacing scheme
-interpolatemethodpixel color interpolation method
-limittype valuepixel cache resource limit
-listtypeColor, Configure, Delegate, Format, Magic, Module, Resource, or Type
-logformatformat of debugging information
-maskfilenameassociate 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.
-precisionvalueset 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-factorgeometryhorizontal and vertical sampling factor
-setattribute valueset an image attribute
-sizegeometrywidth and height of image
-stripstrip image of all profiles and comments
-uniquedisplay image the number of unique colors in the image.
-unitstypethe units of image resolution
-verboseprint detailed information about the image
-versionprint version information
-virtual-pixelmethodaccess method for pixels outside the boundaries of the image
About ImageMagick