import sys
import numpy as np
from PIL import Image
a = np.asarray(Image.open(sys.argv[1]).convert("RGB")).astype(int)
dark = a.sum(axis=2) < 200
ys, xs = np.where(dark)
x0, x1, y0, y1 = xs.min() + 8, xs.max() - 8, ys.min() + 8, ys.max() - 8
light = (a.sum(axis=2) > 500)[y0:y1, x0:x1]
ys, xs = np.where(light)
mid = (xs.min() + xs.max()) / 2
sel = xs < mid
lx, ly = xs[sel], ys[sel]
w = lx.max() - lx.min() + 1; h = ly.max() - ly.min() + 1
out = [f"arc {w}x{h} h/w {h / w:.2f}"]
for f in (0.03, 0.2, 0.5, 0.8, 0.97):
    x = int(lx.min() + f * (w - 1)); col = ly[lx == x]
    out.append(f"{f}: {((col.max() - col.min() + 1) / w if len(col) else 0):.2f}")
print("  ".join(out))
