Raster vs vector
There are two fundamentally different ways to store an image. A raster format stores a grid of pixels — each pixel's colour is recorded explicitly. JPG, PNG, WebP, AVIF and HEIC are all raster formats. A vector format stores instructions — lines, curves, shapes, fills. SVG is the only mainstream vector format on the web.
The difference matters when you scale the image. A 100×100 raster logo looks crisp at 100×100, blurry at 300×300, and pixellated at 2000×2000 — you only have 10,000 pixels to work with. A vector logo describes itself with mathematical curves and looks crisp at any size from a smartwatch favicon to a 4K billboard.
The rule: use vector (SVG) for any image with clear geometric structure — logos, icons, illustrations, charts, UI graphics. Use raster (JPG / WebP / AVIF) for photographs and anything that doesn't have clean vector shapes. PNG sits in the middle: raster, but designed to be used for the kind of graphic content where SVG isn't an option.
Lossy vs lossless
Image compression algorithms come in two flavours. Lossless compression stores every pixel exactly — decoding the file produces a bit-identical copy of the original. PNG and (lossless) WebP are the main lossless raster formats; SVG is also lossless by nature.
Lossy compression discards data the human eye is unlikely to notice. JPG, WebP (lossy mode), AVIF and HEIC are all lossy. The trade-off is dramatic: a lossy JPG of a photograph is typically 10–20× smaller than the same image as a lossless PNG, with no visible quality difference at normal viewing sizes.
The rule: use lossy compression for photographs (the eye doesn't notice subtle changes in millions of pixels). Use lossless for graphics, screenshots, line art and anything with sharp edges where any artefact would be visible. Re-encoding a lossy image compounds quality loss — keep editing sources in a lossless format and only export to lossy when you publish.
Transparency and animation
Which formats support an alpha channel (transparency) and animation:
Browser support
Global browser coverage by format (current versions, mid-2026):
| Format | Coverage | Safari support |
|---|---|---|
| JPG | 100% | All versions |
| PNG | 100% | All versions |
| WebP | 98% | 14+ (2020) |
| AVIF | 93% | 16+ (2022) |
| HEIC | 5% | 17+ (2023) on macOS / iOS — works |
| SVG | 100% | All versions |
HEIC's 5% coverage reflects Safari-only support — virtually no other browser renders HEIC without an additional licensed decoder.
Performance and SEO impact
Image weight is the single biggest factor in web-page performance. Google's Core Web Vitals — Largest Contentful Paint (LCP) in particular — are dominated by the hero image on most pages. A slow LCP hurts both rankings (Google has used Core Web Vitals as a ranking signal since 2021) and conversion (every additional second of LCP costs visible bounce rate).
The fastest win on most sites is migrating photographic content from JPG to WebP — typically a 25–35% reduction in image bytes with no visible quality change. The next win is making sure graphics aren't shipped as PNG when SVG or lossless WebP would do. The third is right-sizing: most sites still serve 4000-pixel originals when they only render at 1200 pixels.
The website image optimiser audits a folder of images and applies these three optimisations automatically — typically cutting total image weight by 60–80%.
File-size comparison
Typical bytes per pixel for a photographic source at web quality (lower = smaller file at the same visual quality):
| Format | Bytes per pixel | 2400×1600 photo |
|---|---|---|
| JPG | 0.18 – 0.40 | ~1,088 KB |
| PNG | 1.50 – 6.00 | ~14,063 KB |
| WebP | 0.12 – 0.30 | ~788 KB |
| AVIF | 0.08 – 0.22 | ~563 KB |
| HEIC | 0.10 – 0.25 | ~656 KB |
For graphics rather than photographs the numbers shift — PNG often wins over JPG, and WebP wins everywhere. SVG is excluded because it's not bytes-per-pixel: an optimised SVG icon is often under 2 KB regardless of rendered size.
Quick-reference matrix
When to use which:
Photograph for the web
WebP (or AVIF if you can serve a fallback)
WebP is 25–35% smaller than JPG with universal modern browser support. AVIF saves another 20% but costs more in decode and tooling.
Photograph for email or legacy
JPG
Universal compatibility. Quality 80–85 is the sweet spot.
Logo or icon
SVG
Vector, infinitely scalable, tiny file size, accessible, animatable.
Screenshot or graphic with sharp edges
PNG (or lossless WebP)
Lossless preserves every pixel. WebP is ~25% smaller than PNG with identical quality.
Animated graphic
Animated WebP (or MP4)
Dramatically smaller than animated GIF; supported in every current browser.
iPhone photo to share
JPG (convert from HEIC)
HEIC isn't supported outside Apple. Convert HEIC to JPG for universal compatibility.
Format guides
A dedicated deep-dive on each format we maintain coverage for.
The JPG format, explained
JPG is the universal format for photographs on the web — and the right answer about 80% of the time.
Open guide →
The PNG format, explained
PNG is lossless and supports transparency — the right answer for screenshots, logos and graphics, but the wrong answer for photographs.
Open guide →
The WebP format, explained
WebP compresses 25–35% better than JPG for photos and 25% better than PNG for graphics — and supports transparency and animation in one format.
Open guide →
The AVIF format, explained
AVIF is the smallest mainstream image format — typically 20% smaller than WebP at equivalent visual quality.
Open guide →
The HEIC format, explained
HEIC is the default iPhone photo format — efficient, but inconvenient outside the Apple ecosystem.
Open guide →
The SVG format, explained
SVG is the right answer for any image that needs to scale — logos, icons, illustrations, charts, UI graphics.
Open guide →
Comparison pages
Head-to-head verdicts for the format decisions people search for most.
JPG vs PNG: which format should you use?
JPG for photographs, PNG for graphics. The right choice usually comes down to whether your image has sharp edges or transparency.
Read comparison →
WebP vs JPG: should you switch?
WebP is 25–35% smaller than JPG at equivalent quality. If you control web delivery, switching is almost always worth it.
Read comparison →
PNG vs WebP: which format wins?
Lossless WebP is ~25% smaller than PNG for the same image with identical transparency support. For web delivery, WebP usually wins.
Read comparison →
AVIF vs WebP: the modern format showdown
AVIF is 20% smaller than WebP at equivalent quality — but slower to decode, harder to encode, and a bit less universally supported.
Read comparison →
HEIC vs JPG: iPhone photo format, explained
HEIC is half the size of JPG at the same quality — but most non-Apple platforms can't open it. JPG remains the universal standard.
Read comparison →