JPEG is often efficient for photographs but can blur sharp text or edges. PNG preserves exact pixels and transparency, making it useful for screenshots and graphics. WebP supports both lossy and lossless modes; compare its output rather than assuming one format always wins.
First resize from an untouched master to the dimensions the page will display. Export a few candidates, then inspect fine text, gradients, and transparency at real viewing size. Watch metadata and color profiles when those matter. Repeatedly saving a JPEG adds artifacts, so generate each derivative from the master. File size is important, but the smallest file is not useful if it destroys the detail the image needs to communicate.