WebP at a moderate quality is often the smallest file that still looks like the photo. This page uses the Squoosh WebP encoder in a worker. Quality 100 switches to lossless WebP, which is the right idea for a graphic you cannot bear to blur.
You can cap the longest side if the source is a 4000-pixel export that will only ever be shown at 1600.