Reference · Formats

Four formats
cover everything

Almost every image decision is a choice between JPEG, PNG, WebP and AVIF. The other formats exist, but they solve narrower problems — print masters, phone capture, and a 1987 animation format nobody has replaced.

Compression · Alpha · Animation · HDR · Support
4 formats that ship2 lossless options0 uploads
Comparison

The table

Read down the columns you need. If you only care about one format, each has its own page.

FormatCompressionAlphaAnimationBest for
JPEGLossy (DCT)NoNoPhotographs, universal delivery
PNGLossless (deflate)YesNoScreenshots, UI, text, exact pixels
WebPBothYesYesWeb delivery with wide support
AVIFBoth (AV1)YesYesSmallest delivery files, HDR
HEICLossy (HEVC)YesNoPhone capture, Apple workflows
GIFLossless (palette)1-bit onlyYesShort flat loops, chat clients
TIFFBoth, taggedYesNoPrint masters, scans, archives
SVGText (gzip)YesCSS/SMILIcons, logos, diagrams
AVIF vs JPEG at equal visual quality 50 Roughly half the bytes — the widest gap of any pair in this table.
Columns

What each column actually decides

Compression type decides whether you get a quality dial. The rest decide whether the file can even represent your image.

Legend

The four properties that matter

A format is not a quality level. It is a set of allowed features plus a compression scheme, and picking badly costs you either bytes or capability.

Compression: lossy or lossless

Lossless formats guarantee exact pixels. Lossy formats trade detail for size and give you a quality setting to choose with. WebP and AVIF offer both modes, which is why "is WebP lossless?" has no single answer — the two promises differ and the file does not announce which one it used.

Alpha, animation, HDR

JPEG cannot store transparency at all, so any design that needs a cut-out must leave JPEG behind. Animation is a separate capability again: PNG has no animated form in the standard, GIF does but with a 256-colour palette, and both WebP and AVIF can animate. HDR and wide-gamut content need 10-bit or 12-bit support, which in practice means AVIF.

If you need alpha and small files, the choice is WebP or AVIF. If you need exact pixels and alpha, it is PNG or lossless WebP — JPEG is not on the list.

Support

Who can actually open them

Support is not uniform, and it is the only reason JPEG is still the default for delivery.

FormatModern browsersOlder desktop apps
JPEGUniversalUniversal
PNGUniversalUniversal
WebPUniversal in current versionsPatchy before 2018
AVIFCurrent Chrome, Firefox, SafariRarely

For the web, "modern browsers" is the list that matters and WebP/AVIF are safe with a fallback. For email attachments, thumbnails in third-party tools, or files sent to a client's Word document, JPEG remains the only format you can hand over without a conversation.

Migration

Moving a legacy site, in order

Do not convert everything at once. Each step is independently verifiable, which is what keeps a migration from becoming a quality incident.

01 01
Recompress the JPEGs

Same format, better encoder settings. Typically halves the photograph payload with no format risk.

02 02
Convert the PNG graphics

Screenshots and UI assets move to WebP — the biggest single win, usually 70–85%.

03 03
Resize before converting

A 4000px original delivered at 1080px is waste in any format. Fix dimensions first, then format.

04 04
Serve AVIF where supported

Only after the above. AVIF subtracts from an already-optimised baseline; it cannot rescue oversized images.

05 05
Keep one original

Archive the master untouched. Every conversion downstream is regenerable from it.

Limits

When format choice is not the answer

Format is the cheapest lever to change and the easiest to overrate. These cases need a different lever first.

Oversized images Format cannot fix 6000px of pixels delivered at 800px. Resize first.
Heavy metadata EXIF and colour profiles are container bytes; stripping them is unrelated to the codec.
Animated GIFs No image format wins here — the loop belongs in a video container.
Print masters Lossless and large is correct. Optimising a master is how archives get destroyed.
FAQ

Formats — FAQ

Which format is smallest?

AVIF, then WebP, then JPEG, with PNG last for photographs. On flat graphics PNG can beat JPEG badly, which is why the answer depends on content as much as format.

Can I just use WebP for everything?

For web delivery, mostly yes — it covers lossy, lossless, alpha and animation. For handing files to other people or desktop apps, JPEG is still safer.

Is converting PNG to WebP lossless?

It can be; lossless WebP is a real mode. If you convert a screenshot with the lossy mode you will see ringing around glyph edges. PNG to WebP covers the choice.

What about HEIC, TIFF and SVG?

They solve different problems: phone capture, print masters, legacy animation and vector graphics. None competes with the four above for web delivery.

Does the extension tell me the compression?

No. WebP and AVIF are containers for both lossy and lossless modes, and a `.webp` file could be either.

Convert between them, offline.
Keep, convert, resize or rename — one pass over a folder, with real before/after numbers.