zoukankan      html  css  js  c++  java
  • mac上使用sips命令快速裁剪、旋转、翻转图片

    原文:https://www.cnblogs.com/stono/p/11021060.html

    日常开发工作中,经常碰到要对图片进行一些简单的处理,不需要动用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
    来源:简书
    简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。

  • 相关阅读:
    PHP常用代码大全(新手入门必备)
    一代大商孟洛川的经商之道
    Photoshop调出田园照片唯美手绘油画效果
    Photoshop调出外景婚片蓝色小清新艺术效果
    photoshop快速把新照片制作成老照片教学
    Photoshop调出清晰的阴雨天气山水风景照
    PS调出清新风格社区街拍照片
    PS调出韩式米黄色室内婚纱照片
    PS调出唯美紫蓝色天空背景女生照片
    PS快速调出天蓝色清新外景
  • 原文地址:https://www.cnblogs.com/albert1017/p/14511217.html
Copyright © 2011-2022 走看看