mac下圖片批量處理

來源:互聯網
上載者:User

fjh-mac-pro:2013_04_27 fengjianhua$ 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 

在 Mac 中有沒有快速縮小圖片尺寸的方法
比如,你想要將某檔案夾的 n 張大尺寸JPG圖片都縮小成寬度為600px的圖片,高度自動按比例縮放。那麼命令則為(假設檔案夾的路徑為 ~/Desktop/fengjianhua):
sips -Z 600 ~/Desktop/fengjianhua/*.JPG
執行完成之後,你案頭上fengjianhua檔案夾中的所有JPG圖片都縮小成寬度為600px的小尺寸版本了。另外,sips 還有很多功能有待你挖掘,比如你還可以指定高度和寬度(注意z需要小寫):
sips -z 300 600 ~/Desktop/fengjianhua/*.JPG
你還可以用 sips 命令批量旋轉圖片,預設旋轉方式為順時針,下面是將圖片順時針旋轉90度的方法:
sips -r 90 ~/Desktop/fengjianhua/*.JPG
其實,你甚至可以以不規則的角度旋轉,比如旋轉120度,大家自己試試是什麼效果吧。
還可以用來翻轉圖片,不管是水平翻轉還是垂直翻轉都可以。水平翻轉命令為:
sips -f horizontal ~/Desktop/fengjianhua/*.JPG
垂直翻轉命令為:
sips -f vertical ~/Desktop/fengjianhua/*.JPG

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.