下载ImageMagick。然后写个脚本转换所有png图片。
import os CMD = r'C:\Program Files\ImageMagick-6.9.1-Q16\convert.exe' #ImageMagick安装目录下convert.exe所在目录 SOURCE_PATH = r'C:\effect2\resource' #png图片所在目录 def doStrip(path): data = {}; print(path) for root, dirs, files in os.walk(path): for file in files: name = file.lower(); if name.find('.png') != -1: path = os.path.join(root, file) os.system('"{0}" {1} -strip {1}'.format(CMD, path, path)); doStrip(SOURCE_PATH)