The transparent portraits came out of background removal as ten PNGs at roughly 4 MB each. Forty megabytes of hero image is a non-starter on a portfolio page. The pipeline that shipped converts every PNG to WebP twice, side by side, and the bundle ships the smaller folder.
The conversion is in Python via Pillow. Two folders come out: about-photo-webp (lossless) and about-photo-webp-q92 (quality 92, alpha quality 100, method 6). Lossless lands at around 11 MB across ten frames. The lossy q=92 set lands at around 1.5 MB. The visual difference at the size the photo gets displayed is invisible to my eye.
I kept the lossless folder anyway. The bundle README documents the swap: if I ever want to switch, the only edit is one variable in ship.sh that points ASSETS at the other folder. The choice stays open, but the default is the small one.
A few details that matter for portraits with alpha. The save call uses alpha_quality=100 even at color quality 92. The alpha channel is where the soft edge of the head and shoulders lives; any compression there shows up as a hard halo on the aurora behind the photo. The exact=True flag preserves the full alpha precision instead of premultiplying. method=6 is the slowest compression mode, but it runs once per asset on my machine, so the build time is invisible.
Default to the lighter file. Keep the heavier one accessible. The principle is to make the cheap choice the visible default and the expensive choice a single line away.