Files
Teletext-Editor/convert_icon.py
Daniel Dybing 9fc75b7e39
Some checks failed
Build Linux / Build Linux (push) Successful in 1m13s
Build Windows / Build Windows (push) Has been cancelled
Add app icon and update build process
2026-01-13 18:23:00 +01:00

18 lines
548 B
Python

from PIL import Image
import os
def convert_to_ico(png_path, ico_path):
if not os.path.exists(png_path):
print(f"Error: {png_path} not found.")
return
try:
img = Image.open(png_path)
img.save(ico_path, format='ICO', sizes=[(256, 256), (128, 128), (64, 64), (48, 48), (32, 32), (16, 16)])
print(f"Successfully converted {png_path} to {ico_path}")
except Exception as e:
print(f"Error converting image: {e}")
if __name__ == "__main__":
convert_to_ico("app_icon.png", "app_icon.ico")