import PythonMagick img = PythonMagick.Image('image.png') img.sample('64x64') img.write('image_64x64.ico') img.sample('128x128') img.write('image_128x128.ico')
#ps: download PythonMagick (Unofficial Windows Binaries for Python Extension Packages)
#ps: install PythonMagick (e.g. pip install C:UsersAdministratorDesktopPythonMagick-0.9.19-cp38-cp38-win32.whl)
#ps: 图标下载地址easyicon