import sys, os sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "services", "recolor")) import numpy as np from PIL import Image m = np.asarray(Image.open("tmp/dbg_pf/01_matte.png"), dtype=np.uint8) / 255.0 h, w = m.shape print("matte shape", m.shape) # profil alfy w dolnej czesci — gdzie matte przechodzi w 0 for y in range(int(h*0.60), int(h*0.80), int(h*0.015)): row = m[y] print(f"y={100*y/h:.1f}%: mean={row.mean():.3f} max={row.max():.2f} >0.04={100*(row>0.04).mean():.1f}% >0.3={100*(row>0.3).mean():.1f}% >0.5={100*(row>0.5).mean():.1f}%")