#!/usr/bin/env python3
"""Blur client names - v6 shifted coordinates."""

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

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

# All Y coordinates shifted down ~30px based on v5 results
blur_regions = [
    # "*Phat Foods:*" first bullet
    (30, 125, 230, 175),
    
    # "*Spoken:* Dovi remarks"
    (30, 190, 580, 240),
    
    # "SparkBeyond, White Space, Finally Foods"
    (175, 245, 730, 300),
    
    # "*1. Phat Foods Deadline Approaching*"
    (0, 395, 620, 455),
    
    # "*2. Spoken Project (Dovi Remarks)*"
    (0, 575, 655, 635),
    
    # "1. *Phat Foods check-in*"
    (25, 1065, 395, 1125),
    
    # "2. *Complete Dovi review*"
    (25, 1140, 420, 1200),
]

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