"""Offline packing of neutral seated guest artwork, not game logic.""" import struct from pathlib import Path from PIL import Image ROOT = Path(__file__).resolve().parents[2] def main(): image = Image.open(ROOT / "assets/sprites/roulette/participants-v1.png").convert("RGBA") assert image.size == (1536, 1024) frames = [] for row in range(2): for col in range(3): frame = image.crop((col * 512, row * 512, (col + 1) * 512, (row + 1) * 512)) frame = frame.resize((192, 192), Image.Resampling.NEAREST) assert frame.getpixel((0, 0))[3] == 0 assert sum(a >= 240 for a in frame.getchannel("A").get_flattened_data()) > 8000 frames.append(frame.tobytes("raw", "BGRA")) data = b"".join(frames) output = ROOT / "assets/animations/roulette/participants-v1.bin" output.write_bytes(struct.pack("<4sIIII", b"ANM1", 192, 192, 6, len(data)) + data) print("Packed six neutral seated guest frames for native Russian roulette") if __name__ == "__main__": main()