pil 获取图像尺寸_从命令行获取图像尺寸

pil 获取图像尺寸

The command line is a gold mine if you come from the perspective of a UI lover.  Getting information from the shell instead of opening an app, finding a file or directory, etc...what a novel concept.  Opening different image files opens up different apps on my Mac and, as the kids say, "ffs" -- I just want to know the image dimensions.

如果您从UI爱好者的角度来看,那么命令行就是金矿。 从外壳程序获取信息而不是打开应用程序,查找文件或目录等……这是一个新颖的概念。 打开不同的图像文件会在Mac上打开不同的应用程序,就像孩子们说的那样,“ ffs”-我只想知道图像的尺寸。

Using ImageMagick you can find the dimensions of an image from command line:

使用ImageMagick,您可以从命令行找到图像的尺寸:


# Get the size of a JPG
convert photo.jpg -print "Size: %wx%h\n" /dev/null
# Size: 600x872

# Get the size of a PSD
convert website-design.psd -print "Size: %wx%h\n" /dev/null
# Size: 990x1200


You can get the image dimensions of any image type from PNG to JPG to GIF to even PSDs.  And the resulting text is as plain as it could be.  Dimensions...here you are.

您可以获取任何图像类型的图像尺寸,从PNG到JPG到GIF甚至是PSD。 结果文本尽可能的简单。 尺寸...就在这里。

翻译自: https://davidwalsh.name/image-dimensions-command-line

pil 获取图像尺寸

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值