python convert png to ico

Solutions on MaxInterview for python convert png to ico by the best coders in the world

showing results for - "python convert png to ico"
Mathilda
21 Nov 2020
1from PIL import Image
2filename = r'logo.png'
3img = Image.open(filename)
4img.save('logo.ico')
5
6# ====================
7
8# Optionally, you may specify the icon sizes you want:
9
10icon_sizes = [(16,16), (32, 32), (48, 48), (64,64)]
11img.save('logo.ico', sizes=icon_sizes)