隨著工齡的漸長,發覺越來越懶,對於繁瑣的事情,總想少干點,就像今天提及的APP圖標這個事,往常的做法無非是兩種,一是讓UI工程師提供所有尺寸的圖標,二是UI工程師給出一個大圖標,自己縮小,方法一可謂是害己又害人,雖然開發者的工作量少,但一旦圖標調整,苦了UI工程師,又累了開發者(要自己替換圖標);方法二,那可是夠累,打開PS,調整圖像大小,保存,調整圖像大小,保存…,今天可謂終於忍無可忍,決定寫一個腳本ios-icon-generator,下面簡單介紹下.
它是一個shell腳本,可以在MACOSX的bash直接運行,它依賴於強大的ImageMagick,因此在使用它之前,請先安裝ImageMagick
sudo brew install ImageMagick
git clone https://github.com/smallmuou/ios-icon-generator cd ios-icon-generator chmod 777 ios-icon-generator.sh
StarnetdeMacBook-Pro:ios-icon-generator starnet$ ./ios-icon-generator.sh ~/Downloads/1024.png ~/output [INFO] Generate iTunesArtwork.png ... [INFO] Generate [email protected] ... [INFO] Generate Icon-Small.png ... [INFO] Generate [email protected] ... [INFO] Generate [email protected] ... [INFO] Generate Icon-Small-40.png ... [INFO] Generate [email protected] ... [INFO] Generate [email protected] ... [INFO] Generate Icon-60.png ... [INFO] Generate [email protected] ... [INFO] Generate [email protected] ... [INFO] Generate Icon-76.png ... [INFO] Generate [email protected] ... [INFO] Generate Icon.png ... [INFO] Generate [email protected] ... [INFO] Generate Icon-72.png ... [INFO] Generate [email protected] ... [INFO] Generate Icon-Small-50.png ... [INFO] Generate [email protected] ... [INFO] Generate Done.
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 [email protected] -rw-r--r-- 1 starnet staff 6954 May 18 17:45 [email protected] -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 [email protected] -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 [email protected] -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 [email protected] -rw-r--r-- 1 starnet staff 4723 May 18 17:45 [email protected] -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 [email protected] -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 [email protected] -rw-r--r-- 1 starnet staff 2393 May 18 17:45 [email protected] -rw-r--r-- 1 starnet staff 1828 May 18 17:45 Icon.png -rw-r--r-- 1 starnet staff 4491 May 18 17:45 [email protected] -rw-r--r-- 1 starnet staff 19995 May 18 17:45 iTunesArtwork.png -rw-r--r-- 1 starnet staff 30653 May 18 17:45 [email protected]
該腳本使用起來非常簡單,需要的朋友歡迎使用.