21.1 KB in, 282 KB out. That was a 451×300 cat photo going from AVIF to PNG, thirteen times larger. A 1000×872 picture of the Hubble Deep Field went from 165 KB to 2.0 MB. Not one pixel changed in either case, and both PNGs kept the color profile the AVIF carried. That trade only makes sense in some situations.
Which format, when
- Leave it as AVIF if it already opens where you need it. Current browsers show AVIF, and it is the smallest of the three.
- Pick JPG for sharing and uploads. The same cat photo as a JPG was 27.0 KB, a tenth of the PNG. AVIF to JPG does that.
- Pick PNG when the image has a transparent background, such as a logo or a cut-out product shot. A JPG would fill it with white.
- Pick PNG when you will edit and save it again and again in an app that does not read AVIF. Each JPG save adds a little loss; PNG saves add none.
- Pick PNG when a form or template asks for PNG, and accept the size.
Where the size goes
AVIF is a still frame encoded with the AV1 video codec. It describes the picture as smooth shapes and gradients and quietly drops fine texture the eye is unlikely to miss. PNG works the other way round: it stores each pixel exactly and only squeezes out repetition, such as runs of the same color. A logo with flat colors has lots of repetition. A photo, where neighboring pixels nearly always differ a little, has almost none. That is why the cat photo grew thirteen times, while a flat graphic would grow far less.
If the PNG is too big for where it is going, Compress image can trim it a little without changing any pixels, or turn it into a much smaller JPG or WebP.
An animated AVIF gives you a PNG of its first frame.