from pathlib import Path import json,gzip,hashlib import numpy as np from PIL import Image,ImageDraw O=Path(__file__).resolve().parent;C=O/'actual-once-focused3-water-context';OLD=O.parent/'hd-second7-SourceG2-H5647-genuine-context-author-20261019-v1/actual-once-second7-genuine11-G2-H5647';P=O/'focused-context-pages';P.mkdir();new=json.loads((C/'ACTUAL-10521-FOCUSED-WATER-SUCCESSOR-THREE-CONTEXTS.json').read_text());old=json.loads((OLD/'ACTUAL-SECOND7-GENUINE11-SOURCEG2-H5647-CONTEXTS.json').read_text());pal=np.frombuffer((C/'actual-palette-rgb.bin').read_bytes(),np.uint8).reshape(256,3);assert (C/'actual-palette-rgb.bin').read_bytes()==(OLD/'actual-palette-rgb.bin').read_bytes() def cls(a):return np.where(a<240,0,np.where(a<245,1,np.where(a<250,2,a))).astype(np.uint8) def arr(r,where): a=np.frombuffer(gzip.decompress((where/r['indexed']).read_bytes()),'