#!/usr/bin/env python3
"""Blur client names - v7 targeting visible remaining text."""

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-v7.jpg"

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

# Keep working regions from v6, adjust others
blur_regions = [
    # Working from v6:
    (30, 125, 230, 175),      # Phat Foods first bullet
    (30, 190, 580, 240),      # Spoken + Dovi
    (175, 245, 730, 300),     # SparkBeyond etc
    
    # Adjusting these - need to go UP not down:
    # "*1. Phat Foods Deadline Approaching*" - try y=350-405
    (0, 350, 620, 410),
    
    # "*2. Spoken Project (Dovi Remarks)*" - try y=530-590
    (0, 530, 655, 590),
    
    # "1. *Phat Foods check-in*" - these are way down, try y=1025-1085
    (25, 1025, 395, 1085),
    
    # "2. *Complete Dovi review*" - try y=1095-1155
    (25, 1095, 420, 1155),
]

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}")
