Quick comparison

FeatureJPEGPNGWebPAVIF
LossyYesNoYesYes
LosslessNoYesYesYes
Alpha channelNoYesYesYes
AnimationNoNo (APNG separately)YesYes (limited tooling)
Typical encode CPULowMediumMediumHigh

Responsive delivery

Use <picture> with AVIF first, WebP second, JPEG/PNG fallback. CDNs can transcode on the fly from a high-quality master.

<picture>
  <source type="image/avif" srcset="photo.avif">
  <source type="image/webp" srcset="photo.webp">
  <img src="photo.jpg" alt="…" width="800" height="600" loading="lazy">
</picture>
Encoding cost. AVIF encodes slowly; pre-build at deploy time or cache at the edge. Real-time user uploads may stay JPEG until a background job recompresses.