mac上使用sips命令快速裁剪、旋轉、翻轉圖片

mac上使用sips命令快速裁剪、旋轉、翻轉圖片工具

平常開發工做中,常常碰到要對圖片進行一些簡單的處理,不須要動用PS,在mac上就有一個很好的命令行工具:sips
這裏咱們不具體展開講,僅貼出幾個經常使用的操做示例,更多用法請你們自行研究
自適應裁剪圖片
sips -Z 600 meinv.jpg
其中600表示高度爲600px,寬度爲按比例縮放
固定寬度
sips -z 100 200 meinv.jpg
其中100表示高度爲100px,寬度爲200px
旋轉
sips -r 90 meinv.jpg
向右旋轉90度
水平方向/垂直方向翻轉圖片
sips -f horizontal meinv.jpg
sips -f vertical meinv.jpg
最後附上spis的幫助信息
➜ doc 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

做者:上官偉斌
連接:https://www.jianshu.com/p/56a656181f30
來源:簡書
簡書著做權歸做者全部,任何形式的轉載都請聯繫做者得到受權並註明出處。
相關文章
相關標籤/搜索