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
来源:简书
简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。

最新文章

  1. 使用Oracle调度程序自动完成任务
  2. mysql连接的一些问题。
  3. 部署Maven核心程序
  4. WebApi支持命名空间重名问题
  5. 判断A树是否包含B树结构
  6. 京东商城招聘scala 高级开发工程师 T3级别
  7. stl之map容器的原理及应用
  8. How to write own add-in for SSMS 2012 (Final release version)
  9. .NET C#到Java没那么难,DB篇
  10. phpcms2008远程代码执行漏洞
  11. Android的WebView调试工具(无需Fan墙,可同时调试多个设备,永不过期)
  12. 2018-2019-2 20165336《网络对抗技术》Exp0 Kali安装 Week1
  13. Asp.Net Boilerplate Project 使用swagger调试api
  14. linux安全配置检查脚本_v0.8
  15. C语言第三讲,基本数据类型
  16. 自己动手实现java数据结构(七) AVL树
  17. 使用javassist进行动态编程
  18. 使用jquery.mCustomScrollbar自定义滚动条(3)callback onCreate
  19. 打开Android系统安装APK的页面
  20. MySQL统计数据库大小

热门文章

  1. elasticsearchTemplate操作es
  2. jQuery 页面加载后执行的事件(3 种方式)
  3. 如何利用python教程判断一个 IP 在不在线?
  4. Linux-负载均衡HAproxy
  5. 逆向破解之160个CrackMe —— 006
  6. CentOS7卸载 OpenJDK 安装Sun的JDK8
  7. springboot在idea的RunDashboard如何显示出来
  8. 《Java设计模式》之代理模式 -Java动态代理(InvocationHandler) -简单实现
  9. 异常错误:在可以调用 OLE 之前,必须将当前线程设置为单线程单元(STA)模式
  10. postgres常用运维sql