强烈推荐一个macOS命令行小工具——sips,用于压缩大量高清原图非常方便。
使用范例:
//批量修改图片大小,调整后长边为1000pixel,短边按比例自适应
~ sips -Z 1000 *.JPG
//批量修改图片大小,调整后高1000pixel,宽1500pixel
~ sips -z 1000 1500 *.JPG
// 带参数 --out DIRNAME ,指定输出目录
更多HELP:
➜ ~ sips --help
sips 10.4.4 - scriptable image processing system.
This tool is used to query or modify raster image files and ColorSync ICC profiles.
Its functionality can also be used through the "Image Events" AppleScript suite.
Usages:
sips [-h, --help]
sips [-H, --helpProperties]
sips [image-query-functions] imagefile ...
sips [profile-query-functions] profile ...
sips [image modification functions] imagefile ...
[--out result-file-or-dir]
sips [profile modification functions] profile ...
[--out result-file-or-dir]
Profile query functions:
-g, --getProperty key
-X, --extractTag tag tagFile
-v, --verify
Image query functions:
-g, --getProperty key
-x, --extractProfile profile
Profile modification functions:
-s, --setProperty key value
-d, --deleteProperty key
--deleteTag tag
--copyTag srcTag dstTag
--loadTag tag tagFile
--repair
Image modification functions:
-s, --setProperty key value
-d, --deleteProperty key
-e, --embedProfile profile
-E, --embedProfileIfNone profile
-m, --matchTo profile
-M, --matchToWithIntent profile intent
--deleteColorManagementProperties
-r, --rotate degreesCW
-f, --flip horizontal|vertical
-c, --cropToHeightWidth pixelsH pixelsW
-p, --padToHeightWidth pixelsH pixelsW
--padColor hexcolor
-z, --resampleHeightWidth pixelsH pixelsW
--resampleWidth pixelsW
--resampleHeight pixelsH
-Z, --resampleHeightWidthMax pixelsWH
-i, --addIcon
-o, --optimizeColorForSharing
网友评论