"""Trim transparent padding from the PROLAD logo without resampling it."""
from pathlib import Path
from PIL import Image

source = Path(__file__).parents[1] / "img" / "logo-transparent.png"
image = Image.open(source).convert("RGBA")
bounds = image.getchannel("A").getbbox()

if bounds:
    image.crop(bounds).save(source, optimize=True)
