import struct, os from io import BytesIO from PIL import Image SRC = os.path.join(os.path.dirname(__file__), "holos.png") DST = os.path.join(os.path.dirname(__file__), "icon.ico") SIZES = [16, 24, 32, 48, 64, 128, 256] src = Image.open(SRC).convert("RGBA") entries = [] for size in SIZES: img = src.resize((size, size), Image.LANCZOS) buf = BytesIO() img.save(buf, format='PNG') data = buf.getvalue() w = size if size < 256 else 0 h = size if size < 256 else 0 entries.append((w, h, 32, len(data), data)) with open(DST, 'wb') as f: f.write(struct.pack('