Picking the output format
JPEG for photographs that must open anywhere, PNG for graphics and transparency, WebP for your own website, AVIF for the smallest files where support allows.
The choice decides far more than the file extension. JPEG and WebP and AVIF are lossy, so converting into them costs a little detail; PNG is lossless, so converting into it never loses anything but usually produces a much larger file. Converting a folder of photographs to PNG is the most common mistake here — it multiplies the size with no visible benefit, because photographic detail is exactly what lossy compression handles well.