一键生成iOS各种规格icon——python 脚本

使用python脚本来一键生成iOS所需的各种规格icon。



#!/usr/bin/python
# -*- coding: utf-8 -*-
from PIL import Image
infile = raw_input('Please enter the image path: ')
outPath = raw_input('Please enter the export path: ')
print('infile:' + infile)
img = Image.open(infile)
(w,h) = img.size
print('originW:' + str(w) + ',originH:' + str(h))

arr = [180,152,144,120,114,100,87,80,76,72,57,58,50,40,29]
for index in arr:
newW = index
newH = h * newW / w
outfile = outPath + '/'+ 'Icon-' + str(index) + '.png'
out = img.resize((newW,newH),Image.ANTIALIAS) #resize image with high-quality
out.save(outfile)
print('output file ' + 'Icon-' + str(index) + '.png...')
print('Export all ICONS finished...')

One thought on “一键生成iOS各种规格icon——python 脚本

  1. 仿牌手表, 高仿手表,精仿手表,精仿腕表, ,高仿瑞士名表,精仿腕表,超A精仿手表,超A手表,蜗牛名表,一比一手表,复刻手表

发表评论

电子邮件地址不会被公开。 必填项已用*标注