Skip to content
BENIBIX Learn

Image File Formats

Level 3 · How a digital picture is made

JPEG, PNG, GIF, WebP and AVIF, and what each one is good at. How to pick the file type that keeps a picture sharp and the file small.

Course contentsLesson 9 of 13

After this lesson you can

  • Pick a format for a photo or a logo
  • Say what GIF can and cannot do
  • Explain why WebP and AVIF exist

12 mincovers 6 glossary entries

Worth reading first: Pixels and Image Resolution

Which image file format to use

An image file format is the kind of file a picture is saved as. Five cover nearly everything on the web: JPEG, PNG, GIF, WebP and AVIF. They differ in three ways. Does it lose detail? Can parts be see-through? Can it move? Pick by the picture, not by habit.

JPEG is the usual file for photos, and it dates from 1992. It uses lossy compression, so files are small but some detail is lost. It cannot have see-through parts. Each time a JPEG is edited and saved again, it loses a little more, so keep the original.

PNG keeps every pixel exactly as it was, and it can have see-through parts. That makes it the right choice for logos, screenshots and anything with sharp edges or text. For a photo, a PNG can be several times bigger than a JPEG that looks the same.

GIF is the oldest, from 1987. It can hold at most 256 colors, which is why photos saved as GIF look rough. It is known for short, looping animations. For moving pictures today, a short video file is usually far smaller and smoother.

WebP was made for the web in 2010. It can do the jobs of both JPEG and PNG: lossy or lossless, with see-through parts and even animation. Its photos are often a quarter to a third smaller than a JPEG of the same quality.

AVIF is newer, from 2019, and built on a video format. It can make photos smaller again than WebP while keeping them sharp. All the main browsers now show it. Saving takes longer, so it suits pictures that are made once and seen many times.

A common mistake is to upload a 5 megabyte photo straight from a camera to a website. It looks the same as a 300 kilobyte WebP and loads far slower. Shrink the pixels to the size it is shown at, then save it in a modern format.

JPEG for photos, PNG for sharp edges, and WebP for either. The smallest file is not always the right one.

Five image formats at a glance

FormatLoses detailSee-throughBest for
JPEGYesNoPhotos
PNGNoYesLogos, screenshots
GIFColors cut to 256On or off onlyTiny loops
WebPEitherYesPhotos and graphics on the web
AVIFEitherYesThe smallest web photos

Worked example

A shop page that loaded slowly

An online shop had 40 product photos saved as PNG, about 2 megabytes each. The page took 8 seconds to load on a phone.

The owner saved them as WebP at the size they are shown. Each dropped to about 150 kilobytes, and the page loaded in under 2 seconds.

The words for this lesson6

Check yourself

Which format suits a logo with see-through parts and sharp edges?

Finished this lesson?

Marking it complete also marks its 6 glossary entries learned, which updates your roadmap and your saved page. 0 are already marked.