There is no single best image format. The right choice depends on what is in the image (photo or flat graphic), whether you need transparency or animation, and which browsers and apps must open the file. This guide gives a short decision list, then backs it up with a size test you can reproduce yourself.
Quick decision list
These are general recommendations, mostly following MDN's image format guide:
- Photos for the web: WebP or AVIF, with JPEG as a fallback. MDN: "For raster images, prefer WebP or AVIF" and JPEG "is often a good fallback format for photographs."
- Screenshots, diagrams, line art: lossless encoding, so PNG or lossless WebP.
- Logos and icons: SVG where a vector version exists.
- Simple animations: animated WebP or AVIF; GIF only when you need maximum compatibility.
- Files people will download and open in other apps: JPEG (photos) or PNG (graphics), because every desktop and mobile app opens them.
A reproducible size test
The size comparison below replaces an illustrative chart that appeared in an earlier version of this article. Every number in it was produced on 23 November 2026 with sharp 0.34.5 (libvips 8.17.3, libwebp 1.6.0, libaom 3.13.1) using two synthetic test images. They are not from ImageWand's in-browser tools, and they are specific to these two images: a real photo will give different ratios.

Test images
- Photo-like (1600 x 1000, RGB): a sky gradient, a soft sun, and hills filled with multi-octave value noise plus a small amount of seeded grain. It is generated by code, so anyone can recreate exactly the same pixels.
- Graphic (1200 x 750, RGBA): flat colours, hard edges and thin 2-pixel lines on a transparent background. Download the lossless source: graphic.png.
The photo-like generator (Node.js 20+, npm install sharp):
import sharp from 'sharp'
export function photoLike(W = 1600, H = 1000, seed = 1) {
let s = seed
const rnd = () => (s = (Math.imul(s, 1103515245) + 12345) >>> 0) / 2 ** 32
const G = 257, grid = Float32Array.from({ length: G * G }, rnd)
const vn = (x, y) => { const xi = Math.floor(x), yi = Math.floor(y), fx = x - xi, fy = y - yi
const at = (a, b) => grid[((b % G) * G + (a % G))]
const top = at(xi, yi) * (1 - fx) + at(xi + 1, yi) * fx, bot = at(xi, yi + 1) * (1 - fx) + at(xi + 1, yi + 1) * fx
return top * (1 - fy) + bot * fy }
const tex = (x, y) => vn(x / 64, y / 64) * 0.5 + vn(x / 16, y / 16) * 0.3 + vn(x / 4, y / 4) * 0.2
const px = Buffer.alloc(W * H * 3)
for (let y = 0; y < H; y++) for (let x = 0; x < W; x++) {
const u = x / W, v = y / H
let r = 70 + 120 * v, g = 130 + 80 * v, b = 230 - 60 * v
const sun = Math.max(0, 1 - Math.hypot((u - 0.72) * W / H, v - 0.28) / 0.12)
r += 150 * sun; g += 120 * sun; b -= 40 * sun
const ridge = 0.6 + 0.08 * Math.sin(u * 9) + 0.03 * Math.sin(u * 37)
if (v > ridge) { const t = tex(x, y), d = (v - ridge) * 2
r = 30 + 90 * t + 40 * d; g = 70 + 120 * t + 20 * d; b = 25 + 50 * t }
const n = (rnd() - 0.5) * 6
const i = (y * W + x) * 3, c = k => Math.max(0, Math.min(255, Math.round(k + n)))
px[i] = c(r); px[i + 1] = c(g); px[i + 2] = c(b)
}
return sharp(px, { raw: { width: W, height: H, channels: 3 } })
}
Encoder settings (everything else left at sharp defaults):
img.png({ compressionLevel: 9 })
img.flatten({ background: '#fff' }).jpeg({ quality: 80 })
img.webp({ quality: 80 })
img.webp({ lossless: true })
img.avif({ quality: 50 })
Results
PSNR (peak signal-to-noise ratio) compares each decoded file with the original pixels, after flattening transparency onto white. Higher is closer to the original; "identical" means the pixels match exactly. PSNR is a rough measure and does not always match what people see, so also look at the files yourself.
Photo-like image (1600 x 1000)
| Encoding | Bytes | Size vs PNG | PSNR |
|---|---|---|---|
| PNG, lossless | 1,950,426 | 100% | identical |
| WebP, lossless | 1,191,190 | 61% | identical |
| JPEG, quality 80 | 96,370 | 4.9% | 40.7 dB |
| WebP, lossy quality 80 | 38,940 | 2.0% | 40.6 dB |
| AVIF, quality 50 | 14,101 | 0.7% | 40.6 dB |
Download the lossy outputs: photo-q80.jpg and photo-q80.webp.
Graphic (1200 x 750, with transparency)
| Encoding | Bytes | Size vs PNG | PSNR |
|---|---|---|---|
| PNG, lossless | 15,909 | 100% | identical |
| WebP, lossless | 4,732 | 30% | identical |
| JPEG, quality 80 (alpha flattened to white) | 28,991 | 182% | 37.6 dB |
| WebP, lossy quality 80 | 7,990 | 50% | 38.2 dB |
| AVIF, quality 50 | 3,892 | 24% | 49.1 dB |
What the test shows (and does not show)
- Lossless PNG is the wrong choice for photos. It was roughly 20 times larger than JPEG at quality 80 for the photo-like image.
- JPEG is the wrong choice for flat graphics. It was larger than the lossless PNG and cannot keep transparency.
- Lossless WebP beat PNG on both images, without changing a single pixel.
- The lossy gaps here are larger than you should expect from real photos. Synthetic grain and smooth gradients are easy for modern codecs to simplify. Google's own figures for WebP are more modest: lossy WebP files "25-34% smaller than comparable JPEG images at equivalent SSIM quality index" and lossless WebP "26% smaller in size compared to PNGs" (Google for Developers). Treat both sets of numbers as indications, and test with your own images.
For a larger test with four kinds of image (photo-like, logo, transparent and text), PSNR and SSIM scores, magnified crops and a script that regenerates every number, see our JPEG, WebP, AVIF and PNG compression benchmark.
JPEG
Lossy compression for still images, with no alpha channel (MDN). Every browser and almost every app opens it, which is why it remains the safest file to send to other people. Quality settings are not standardised between encoders, so "quality 80" in one app is not exactly "quality 80" in another. Use JPEG for photos when compatibility matters more than the last few kilobytes, and avoid it for text, screenshots and logos, where its artefacts are visible around hard edges.
PNG
Lossless, with full alpha transparency (MDN). It is ideal for screenshots, diagrams and graphics with sharp edges, and for a master copy you will edit again. It is a poor choice for photos on a web page because the files are large, as the test above shows.
WebP
WebP supports lossy and lossless compression, transparency and animation. MDN lists support in all current versions of Chrome, Edge, Firefox, Opera and Safari, with one caveat for Mac: "You need Safari 14 or later as well as macOS Big Sur (11) or a more recent version." For a deeper look, see the WebP guide.
AVIF: decoding vs encoding
AVIF is the AV1-based image format. It supports lossy and lossless compression, alpha and animation (MDN). It is worth separating two questions:
Can browsers display AVIF (decoding)? Mostly yes. Can I use lists support from Chrome 85, Edge 121, Firefox 93, Safari 16.4 on macOS (partial support in 16.1 to 16.3) and Safari on iOS 16.0 (caniuse.com/avif, accessed 23 November 2026). MDN still advises providing a fallback because support "has little historical depth."
Can your tools create AVIF (encoding)? That depends on the software, not the browser. A browser that displays AVIF does not necessarily let a web page export AVIF from a canvas: the canvas export API falls back to PNG when a format is not supported (MDN, toBlob). In the test above, AVIF was encoded with sharp/libvips on a server-side script, not in a browser.
Format comparison
| Feature | JPEG | PNG | WebP | AVIF |
|---|---|---|---|---|
| Compression | Lossy | Lossless | Lossy or lossless | Lossy or lossless |
| Transparency | No | Yes | Yes | Yes |
| Animation | No | No (APNG is separate) | Yes | Yes |
| Browser display | All | All | All current (Safari 14+ on Big Sur+) | Chrome 85+, Edge 121+, Firefox 93+, Safari 16.4+ |
| Export from ImageWand | Yes | Yes | In browsers that can encode it (Chrome, Edge, Firefox) | Only if your browser can encode it |
| Typical use | Photos, maximum compatibility | Graphics, screenshots, masters | Web photos and graphics | Web photos with a fallback |
Google Search supports "BMP, GIF, JPEG, PNG, WebP, SVG, and AVIF" images (Google Search Central), so choosing WebP or AVIF does not stop an image from being indexed.
Serving a modern format with a fallback
<picture>
<source srcset="hills.avif" type="image/avif">
<source srcset="hills.webp" type="image/webp">
<img src="hills.jpg" alt="Green hills under a blue sky" width="1600" height="1000">
</picture>
The browser uses the first source type it supports and falls back to the img. Drop the AVIF line if you do not have an AVIF encoder; WebP plus JPEG is a reasonable pair on its own.
Converting with ImageWand
The converter processes your image on your device; the image is not uploaded to ImageWand. It reads JPG, PNG, WebP, AVIF, GIF, BMP, TIFF, HEIC, ICO and SVG. For TIFF and HEIC it uses your browser's decoder when there is one and a bundled decoder otherwise. The web formats in this guide come out as:
- JPG: no transparency. Choose JPG output when you want transparent areas on a white background, then check the edges. See PNG to JPG or WebP to JPG.
- PNG: lossless output. See JPG to PNG or WebP to PNG.
- WebP: static WebP with a quality setting, in browsers that can encode it (Chrome, Edge and Firefox; Safari does not offer WebP encoding to web pages). See JPG to WebP or PNG to WebP.
- AVIF: offered only when your browser can encode it, as explained above.
The converter can also write static GIF (256 colours), BMP, TIFF and ICO with ImageWand's own encoders, in any current browser. It cannot write HEIC or SVG.
To convert many files to the same format, the free batch tool converts up to 100 images to JPG, PNG or WebP in your browser and downloads them as one ZIP.
Animated GIF or WebP input is exported as a single still frame. Converting to PNG or WebP does not restore detail a JPEG has already lost; it only changes how the existing pixels are stored. After converting, check the format, dimensions and file size the tool reports.
Related reading
- WebP format guide: lossy vs lossless WebP, animation and what the converter does.
- Compress images without losing quality: lossless vs lossy compression with a reproducible benchmark.
- Optimize images for SEO: responsive markup, alt text and Core Web Vitals.
- HEIC to JPG: the format question specific to iPhone photos.
- Compression benchmark: bytes, PSNR and SSIM for four kinds of image.


