macOS | 一行命令批量处理图片

强烈推荐一个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 
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容