"""Package the original PNG in a Windows ICO without altering its pixels.""" from pathlib import Path import struct root = Path(__file__).resolve().parent png = (root / "assets" / "sub-control-icon.png").read_bytes() if png[:8] != b"\x89PNG\r\n\x1a\n": raise ValueError("Icon source must be PNG") width, height = struct.unpack(">II", png[16:24]) if not (1 <= width <= 256 and 1 <= height <= 256): raise ValueError("Windows icon source must be at most 256 x 256") header = struct.pack("