andrew

png图片转ico图片的转换代码

from PIL import Image

img = Image.open("favicon.png")
img = img.resize((32, 32))
img.save("favicon.ico", sizes=[(32, 32)])