#!/usr/bin/env python3
"""Blur client names - v8 final adjustments."""

from PIL import Image, ImageFilter
import os

input_path = "/Users/assafdagan/.clawdbot/media/inbound/f01c84e1-5f12-4bcf-bfb8-257edba844eb.jpg"
output_path = "/Users/assafdagan/clawd/output/blurred-status-v8.jpg"

img = Image.open(input_path)
w, h = img.size

blur_regions = [
    # Top section (working well from v7):
    (30, 125, 230, 175),      # Phat Foods first bullet
    (30, 190, 580, 240),      # Spoken + Dovi
    (175, 245, 730, 300),     # SparkBeyond etc
    
    # "*1. Phat Foods Deadline Approaching*" - go higher y=335-395
    (0, 335, 620, 395),
    
    # "*2. Spoken Project (Dovi Remarks)*" - y=545-605
    (0, 545, 655, 610),
    
    # Tomorrow's section - go LOWER y=1055-1180
    # "1. *Phat Foods check-in*"
    (25, 1055, 395, 1115),
    
    # "2. *Complete Dovi review*"
    (25, 1125, 420, 1185),
]

result = img.copy()

for (x1, y1, x2, y2) in blur_regions:
    cropped = img.crop((x1, y1, x2, y2))
    blurred = cropped.filter(ImageFilter.GaussianBlur(radius=25))
    result.paste(blurred, (x1, y1))

os.makedirs(os.path.dirname(output_path), exist_ok=True)
result.save(output_path, quality=95)
print(f"Saved: {output_path}")
