How to View Image Metadata with ImageMagick?
This article provides a quick overview of how to inspect image properties, details, and metadata using ImageMagick. While many users associate ImageMagick primarily with image editing and conversion, it also includes powerful tools for extracting hidden data like EXIF, geometry, and color profiles. Below, you will find the exact commands needed to view this information directly from your terminal.
The Correct Command for Image Properties
To view image properties and metadata, you should actually use the
identify command, which is a core part of the ImageMagick
suite, rather than the convert command. While
convert is designed for changing image formats and
modifying visuals, identify is specifically built for data
extraction.
The standard syntax to view basic image details is:
identify image.jpgThis will output the format, dimensions, color space, and file size of the image.
How to View Detailed Metadata and EXIF Data
If you need a deep dive into the metadata (including camera settings,
timestamps, and GPS data), you can use the verbose flag
(-verbose).
identify -verbose image.jpgThis command prints a comprehensive list of every piece of metadata embedded within the file.
Using the Convert Command as an Alternative
If your workflow strictly requires using the convert
command, you can achieve a similar result by using convert
alongside the -ping flag and the info: output
format. The -ping flag efficiently format-checks the
attributes without fully loading the image into memory.
convert image.jpg -ping -info:For a detailed format-specific dump using convert, you
can format the output to print specific metadata attributes like
this:
convert image.jpg -format "%[EXIF:*]" info:Using these commands allows you to quickly audit your image files and manage the hidden data bundled inside them.