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
Level 1 · How color works
Level 2 · Color on screens and paper
Level 3 · How a digital picture is made
Level 4 · Pictures that carry a message
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.
Five image formats at a glance
Worked example
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.