Python 实现 PNG 转 ICON, 各种大小随意定
1 from PIL import Image 2 3 img = Image.open (r"D:\TMP15\EXAM256.png") 4 icon_sizes = [(16, 16), (32, 32), (48, 48), (64, 64), (128, 128), (256, 256)] 5 img.save (r"D:\TMP15\EXAM.ico", sizes=icon_sizes)
1 from PIL import Image 2 3 img = Image.open (r"D:\TMP15\EXAM256.png") 4 icon_sizes = [(16, 16), (32, 32), (48, 48), (64, 64), (128, 128), (256, 256)] 5 img.save (r"D:\TMP15\EXAM.ico", sizes=icon_sizes)