import sys, time, subprocess from PIL import Image name, label = sys.argv[1], sys.argv[2] def grab(out): subprocess.run(["powershell","-ExecutionPolicy","Bypass","-File","grab.ps1", "-Out",out,"-Match",name], capture_output=True) return Image.open(out).convert("RGB") prev = grab("hr_0.png"); changes = [] t0 = time.time() for i in range(1, 13): time.sleep(2) cur = grab("hr_%d.png" % i) pa, pb = prev.load(), cur.load(); w,h = cur.size d = sum(1 for y in range(0,h,4) for x in range(0,w,4) if pa[x,y]!=pb[x,y]) changes.append(d) prev = cur moved = sum(1 for c in changes if c > 20) print("%s: %d of %d samples (2s apart) showed change -> ~%.1f s between updates" % (label, moved, len(changes), (len(changes)*2.0)/max(moved,1))) print(" per-sample changed-pixel counts:", changes)