用 sips 命令居中裁剪图片
用 sips -c 从终端把图片裁剪为指定高宽,四边对称裁切,无需打开编辑器。
运行 `sips -c 1080 1080 photo.jpg` 可将图片居中裁剪为 1080x1080。
01命令
命令
$ sips -c 1080 1080 photo.jpg02作用说明
sips -c 参数先写高度再写宽度,以图片中心为基准对称裁剪,不支持指定偏移位置。需要正方形头像或社交预览图时,可以先 -c 裁剪再用 -z 缩放到目标尺寸。与其他 sips 操作一样,裁剪会直接覆盖原文件,被裁掉的部分无法恢复。
03风险
!注意: 裁掉的像素无法找回,请先保留原图副本。
04撤销
✓无需撤销——该命令不会改变持久状态。
05来源
- sips — scriptable image processing system (macOS man page)依据: Documents sips -c pixelsH pixelsW to crop the image to the given height and width, centered on the original.
最后验证: 2026-09-17 · 分类: 媒体