iOS APP图标一键生成


http://www.2cto.com/kf/201505/400343.html

随着工龄的渐长,发觉越来越懒,对于繁琐的事情,总想少干点,就像今天提及的APP图标这个事,往常的做法无非是两种,一是让UI工程师提供所有尺寸的图标,二是UI工程师给出一个大图标,自己缩小,方法一可谓是害己又害人,虽然开发者的工作量少,但一旦图标调整,苦了UI工程师,又累了开发者(要自己替换图标);方法二,那可是够累,打开PS,调整图像大小,保存,调整图像大小,保存…,今天可谓终于忍无可忍,决定写一个脚本ios-icon-generator,下面简单介绍下.

环境预备

它是一个shell脚本,可以在MACOSX的bash直接运行,它依赖于强大的ImageMagick,因此在使用它之前,请先安装ImageMagick

?
1
sudo brew install ImageMagick

安装

?
1
2
3
git clone https: //github.com/smallmuou/ios-icon-generator
cd ios-icon-generator
chmod 777 ios-icon-generator.sh

运行

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
StarnetdeMacBook-Pro:ios-icon-generator starnet$ ./ios-icon-generator.sh ~/Downloads/ 1024 .png ~/output
[INFO] Generate iTunesArtwork.png ...
[INFO] Generate iTunesArtwork @2x .png ...
[INFO] Generate Icon-Small.png ...
[INFO] Generate Icon-Small @2x .png ...
[INFO] Generate Icon-Small @3x .png ...
[INFO] Generate Icon-Small- 40 .png ...
[INFO] Generate Icon-Small- 40 @2x .png ...
[INFO] Generate Icon-Small- 40 @3x .png ...
[INFO] Generate Icon- 60 .png ...
[INFO] Generate Icon- 60 @2x .png ...
[INFO] Generate Icon- 60 @3x .png ...
[INFO] Generate Icon- 76 .png ...
[INFO] Generate Icon- 76 @2x .png ...
[INFO] Generate Icon.png ...
[INFO] Generate Icon @2x .png ...
[INFO] Generate Icon- 72 .png ...
[INFO] Generate Icon- 72 @2x .png ...
[INFO] Generate Icon-Small- 50 .png ...
[INFO] Generate Icon-Small- 50 @2x .png ...
[INFO] Generate Done.

结果

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
StarnetdeMacBook-Pro:ios-icon-generator starnet$ ls -l ~/output/
total 288
-rw-r--r--  1 starnet  staff   1921 May 18 17 : 45 Icon- 60 .png
-rw-r--r--  1 starnet  staff   4723 May 18 17 : 45 Icon- 60 @2x .png
-rw-r--r--  1 starnet  staff   6954 May 18 17 : 45 Icon- 60 @3x .png
-rw-r--r--  1 starnet  staff   2210 May 18 17 : 45 Icon- 72 .png
-rw-r--r--  1 starnet  staff   5565 May 18 17 : 45 Icon- 72 @2x .png
-rw-r--r--  1 starnet  staff   2184 May 18 17 : 45 Icon- 76 .png
-rw-r--r--  1 starnet  staff   5856 May 18 17 : 45 Icon- 76 @2x .png
-rw-r--r--  1 starnet  staff   1437 May 18 17 : 45 Icon-Small- 40 .png
-rw-r--r--  1 starnet  staff   3267 May 18 17 : 45 Icon-Small- 40 @2x .png
-rw-r--r--  1 starnet  staff   4723 May 18 17 : 45 Icon-Small- 40 @3x .png
-rw-r--r--  1 starnet  staff   1674 May 18 17 : 45 Icon-Small- 50 .png
-rw-r--r--  1 starnet  staff   3992 May 18 17 : 45 Icon-Small- 50 @2x .png
-rw-r--r--  1 starnet  staff   1168 May 18 17 : 45 Icon-Small.png
-rw-r--r--  1 starnet  staff   1786 May 18 17 : 45 Icon-Small @2x .png
-rw-r--r--  1 starnet  staff   2393 May 18 17 : 45 Icon-Small @3x .png
-rw-r--r--  1 starnet  staff   1828 May 18 17 : 45 Icon.png
-rw-r--r--  1 starnet  staff   4491 May 18 17 : 45 Icon @2x .png
-rw-r--r--  1 starnet  staff  19995 May 18 17 : 45 iTunesArtwork.png
-rw-r--r--  1 starnet  staff  30653 May 18 17 : 45 iTunesArtwork @2x .png

综述

该脚本使用起来非常简单,需要的朋友欢迎使用.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值