如何在 Linux 命令行获取图像尺寸(宽x高,像素)

你可以使用以下命令获取图像文件的像素尺寸。在此示例中,plot.png 是你要检查的图像文件名。

image_size.sh
identify -format "%wx%h\n" plot.png

示例输出:

image_size_output.txt
1550x1037

如果不是图像文件的示例输出

image_size_error.txt
identify-im6.q16: no decode delegate for this image format `PY' @ error/constitute.c/ReadImage/580.

Check out similar posts by category: Linux