"""Create transparent header pieces from the cleaned PROLAD logo."""
from pathlib import Path
from PIL import Image

root = Path(__file__).parents[1]
source = Image.open(root / "img" / "logo-transparent.png").convert("RGBA")

# Coordinates are based on the tightly cropped 632 x 472 transparent logo.
# Retain each element's original pixels; CSS controls display size.
icon = source.crop((0, 0, 632, 286))
wordmark = source.crop((0, 286, 632, 405))

icon.save(root / "img" / "logo-icon.png", optimize=True)
wordmark.save(root / "img" / "logo-wordmark.png", optimize=True)
