• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

MAC中用Shell脚本批量裁剪各种尺寸的App图标

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

在APP上架前,一次一次自己剪裁上架需要的各个尺寸的Icon不是程序员该干的事,使用Mac中自带的sips工具可以解决这个需求。
关于sips,在终端中直接执行可以出现以下信息:

复制代码 代码如下:

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.
Try 'sips --help' or 'sips --helpProperties' for help using this tool

它一个脚本图像处理系统,可用于查询和修改图像文件。
下面是刚写的IOS App Icon裁剪脚本,保存成一个.sh文件,在终端里输入sh xx.sh就可以执行了:
复制代码 代码如下:
#!/bin/sh

filename="icon.png"
dirname="cutimg"
name_array=("Icon-29.png" "[email protected]" "[email protected]" "Icon-57.png" "[email protected]" "Icon-120.png")
size_array=("29" "58" "80" "57" "114" "120")

mkdir $dirname

for ((i=0;i<${#name_array[@]};++i)); do
    m_dir=$dirname/${name_array[i]}
    cp $filename $m_dir
    sips -Z ${size_array[i]} $m_dir
done


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
在Shell命令行处理JSON数据的方法发布时间:2022-02-11
下一篇:
Shell脚本判断IP地址是否合法的方法发布时间:2022-02-11
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap