"""Optimize the generated Nigerian construction image for the website."""
from pathlib import Path
from PIL import Image

source = Path(r"C:\Users\ibrea\.codex\generated_images\019ff7c3-f161-7560-b741-01863cb0d21b\exec-6dda1e97-8e22-4695-8bae-4083063097c4.png")
target = Path(__file__).parents[1] / "img" / "nigeria-site-engineers.webp"
with Image.open(source) as image:
    image.convert("RGB").save(target, "WEBP", quality=86, method=6)
