github 开源项目 ios-icon-generator
使用步骤
- 安装ImageMagick
进入终端,敲如下命令
sudo brew install ImageMagick
- 安装完成后,下载开源项目到本地,并对文件赋予最高权限
//克隆到本地
git clone https://github.com/smallmuou/ios-icon-generator
//进入本地文件夹,对文件ios-icon-generator.sh赋予权限
cd ios-icon-generator
chmod 777 ios-icon-generator.sh
- 执行脚本,生成icon
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.
Tip
./ios-icon-generator.sh ~/Downloads/1024.png ~/output 命令格式为:./ios-icon-generator.sh 原图路径(~/Downloads/1024.png) 生成icon的保存路径(~/output )
Usage
VERSION: 1.0.0
USAGE:
./ios-icon-generator.sh srcfile dstpath
DESCRIPTION:
This script aim to generate ios app icons easier and simply.
srcfile - The source png image. Preferably above 1024x1024
dstpath - The destination path where the icons generate to.
This script is depend on ImageMagick. So you must install ImageMagick first
You can use 'sudo brew install ImageMagick' to install it
AUTHOR:
Pawpaw
LICENSE:
This script follow MIT license.
EXAMPLE:
./ios-icon-generator.sh 1024.png ~/123