Read Image Metadata with sips -g
Query pixel size, color space, DPI, and format of any image from Terminal — no Preview needed.
01Command
$ sips -g pixelWidth -g pixelHeight -g space -g dpiWidth image.jpg02What it does
Beyond format conversion, sips is a full property engine: -g <property> fetches one property and `sips -g all image.jpg` dumps everything, including EXIF-ish data like creation date. It can also modify metadata in place — `-s dpiHeight 300 -s dpiWidth 300` rewrites DPI without touching pixels, and -r rotates. Combine with find/xargs to audit a whole folder of images in one line.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- sips — scriptable image processing system (macOS)Evidence: Documents -g to get image properties such as pixelWidth, pixelHeight, space and dpiWidth, and -p for padding operations.
Last verified: 2026-09-17 · Category: Media
06Related solutions
Use kMDItem attributes to search file metadata the Spotlight UI can't express, faster than find ever will.
Render a JPEG or PNG as colored blocks inside the terminal.
Dump every indexed attribute of any file: EXIF, dimensions, duration, authors, content types.