"""Offline packing only: wall paintings and a small iron drainage texture.""" from pathlib import Path import struct from PIL import Image ROOT = Path(__file__).resolve().parents[2] def main(): image = Image.open(ROOT/"assets/sprites/hall/wall-paintings-v6.png").convert("RGBA") frames = [] for side in range(2): part = image.crop((side*image.width//2,0,(side+1)*image.width//2,image.height)) mask = part.getchannel("A").point(lambda a:255 if a>=96 else 0) part = part.crop(mask.getbbox()).resize((128,128),Image.Resampling.LANCZOS) part.putalpha(part.getchannel("A").point(lambda a:255 if a>=128 else 0)) frames.append(part) drain = Image.new("RGBA",(128,128),(51,55,57,255)) for y in range(128): for x in range(128): if 7