快速生成App不同尺寸图标
from PIL import Image
imageDirectory = "/Users/xiaohei/Desktop/PythonFactory/"
imageSize = [29,50,57,58,60,72,76,80,87,100,114,120,144,152,180,1024]
def createImage(size):
im = Image.open(imageDirectory+"/icon_1024.png")
im.resize((size,size), Image.ANTIALIAS).save(imageDirectory+"icon%dx%d.png"%(size,size))
def start():
for size in imageSize:
createImage(size)
if __name__ == "__main__":
start()
Image.NEAREST 低质量
Image.BILINEAR 双线性
Image.BICUBIC 三次样条插值
Image.ANTIALIAS 高质量