📜  python 将 png 转换为 ico - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:12.708000             🧑  作者: Mango

代码示例1
from PIL import Image
filename = r'logo.png'
img = Image.open(filename)
img.save('logo.ico')

# ====================

# Optionally, you may specify the icon sizes you want:

icon_sizes = [(16,16), (32, 32), (48, 48), (64,64)]
img.save('logo.ico', sizes=icon_sizes)