"""Create web-optimized copies of generated website photography."""
from pathlib import Path
from PIL import Image

image_dir = Path(__file__).parents[1] / "img"
for source in image_dir.glob("nigeria-*.png"):
    with Image.open(source) as image:
        image.convert("RGB").save(source.with_suffix(".webp"), "WEBP", quality=86, method=6)
