

用Shell脚本批量裁剪App Icon各个尺寸
source link: https://www.isaced.com/post-247.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

用Shell脚本批量裁剪App Icon各个尺寸
再一次忍不住了,一次一次自己剪裁上架需要的各个尺寸的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
直接执行就可以对你指定的png进行几个XCode必要尺寸进行剪裁缩放,第一次写Shell脚本,这语法真心伤啊…
Recommend
-
33
介绍 硬件平台:全志F1C100s 系统: XBOOT (是个集成了驱动和库的bootloader,没有OS) 工具链:gcc-arm-none-eabi ...
-
36
正文 要求在页面查询到5000条数据,为了方便插入,用shell脚本写curl命令调用自己写的代码接口; 脚本如下: #!/bin/bash a=0 while [ $a -le 10 ]; do # length of ts is 13 required,Through t...
-
16
FFmpeg示例程序合集-批量编译脚本 此前做了一系列有关FFmpeg的示例...
-
9
批量取关:控制台脚本实现新浪微博批量取消关注清明小长假闲来无事,打开了半年多没用的微博,发现密码提示错误。再次确认密码无误后,尝试登录无果,通过密保修改密码,成功登录。看到了自己的关注列表,突然懵逼。多了一百多个关注...
-
3
压缩博客图片尺寸的 Bash 脚本(Linux) 之前一直没管博客图片的大小因为感觉其实不太重要,毕竟是 Github 的免费空间,没有那么大的动力优化图片。 但是最近发现有的博客确实图片太多了,所以加载起来很慢,所以才开始了优化。...
-
6
更通用的压缩博客图片尺寸的 Bash 脚本 今天更新博客,想起来图片还没有压缩格式,所以利用之前的写过的程序 ( 压缩博客图片尺寸 ) 更新博客,但是发现没办法...
-
12
shell实现批量分发ssh公钥生产实践: 批量分发公钥学习技巧: for循环及expect使用脚本内容:
-
4
如何在神经网络中实现不同尺寸图片的批量输入 当我们使用 VGG 或者 ResNet 做图片分类的时候,最后一层接的全连接层的输出尺寸必然是恒定值,即潜在类别数量,尽管骨架卷积网络不要求输入的图片具有相同的尺寸,但为了接上全连...
-
6
V2EX › Coding 各位是如何批量管理项目中的 shell 脚本的?
-
10
Shell脚本调用ansible执行批量操作生产实践: 使用shell脚本调用ansible执行批量操作学习技巧:
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK