-
随着工龄的渐长,发觉越来越懒,对于繁琐的事情,总想少干点,就像今天提及的APP图标这个事,往常的做法无非是两种,一是让UI工程师提供所有尺寸的图标,二是UI工程师给出一个大图标,自己缩小,方法一可谓是害己又害人,虽然开发者的工作量少,但一旦图标调整,苦了UI工程师,又累了开发者(要自己替换图标);方法二,那可是够累,打开PS,调整图像大小,保存,调整图像大小,保存…,今天可谓终于忍无可忍,决定写一个脚本ios-icon-generator,下面简单介绍下.
环境预备
它是一个shell脚本,可以在MACOSX的bash直接运行,它依赖于强大的ImageMagick,因此在使用它之前,请先安装ImageMagick
1sudo brew install ImageMagick
安装
123git clone https:
//github.com/smallmuou/ios-icon-generator
cd ios-icon-generator
chmod
777
ios-icon-generator.sh
运行
123456789101112131415161718192021StarnetdeMacBook-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.
结果
123456789101112131415161718192021StarnetdeMacBook-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
综述
该脚本使用起来非常简单,需要的朋友欢迎使用.
-
iOS APP图标一键生成
最新推荐文章于 2024-05-15 10:08:44 发布