JPG, PNG, or WebP: Which Format for Which Image
Format choice is matching content type to codec strengths, not picking the fanciest name. The right pick cuts file size several-fold at the same quality.
The quick table
JPG: photos and screenshots — lossy compression loves continuous tones, smallest size, no transparency.
PNG: logos, icons, text graphics, anything transparent — lossless, crisp edges; wasteful for photos.
WebP: web delivery — lossy or lossless with transparency, ~30% smaller than JPG; legacy software may not open it.
AVIF: next-step compression for web use; local software support still lags.
Two common mis-picks
Screenshots as JPG: text edges get compression artifacts; PNG is both smaller and cleaner for them.
Photos as PNG: you pay several times the size for detail nobody perceives. Photos belong in JPG or WebP.
Two rules when converting
Lossy→lossless never restores quality (JPG to PNG just grows). PNG→JPG is the compressing direction.
Flatten transparency onto a color before converting to JPG, or the transparent area turns black or white.