Skip to content
Create more with Morphed(opens in a new tab)

Paid AI

Guides

JPG vs PNG vs WebP vs AVIF: Which Image Format Should You Use?

A practical format-choice guide for the web, with a reproducible size test, current browser support for AVIF and WebP, and a clear note on which formats ImageWand can and cannot export.

Author
ImageWand Team
Published
Updated
Reading time
8 min read
Sources checked
November 23, 2026

morphed.app · Paid AI tools

Put this guide to work in a fresh creative project.

Reading "JPG vs PNG vs WebP vs AVIF: Which Image Format Should You Use?"?

Explore AI photo editing in Morphed (opens in a new tab)

Paid AI tools. Separate account and upload in Morphed.

A watercolor portrait surrounded by flowers

A portrait with a painterly feel

Soft watercolor, delicate flowers, a pale backdrop.

AI-created concept image. Results vary.

See an example

One photo, two file formats

A PNG-to-JPG example. The converter shows which outputs your browser supports.

Product photograph saved as PNG

PNG input

Photo with no transparent pixels

Same product photograph saved as JPG

JPG copy

640 x 360 px - 43.2 KB

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.

Two synthetic test images: a landscape-like scene with a gradient sky, soft sun and textured green hills, and a flat teal graphic with an orange circle, white bars and thin vertical lines.
Left: the photo-like test image (1600 x 1000, generated from code). Right: the graphic test image (1200 x 750, transparent corners shown here on grey).

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)

EncodingBytesSize vs PNGPSNR
PNG, lossless1,950,426100%identical
WebP, lossless1,191,19061%identical
JPEG, quality 8096,3704.9%40.7 dB
WebP, lossy quality 8038,9402.0%40.6 dB
AVIF, quality 5014,1010.7%40.6 dB

Download the lossy outputs: photo-q80.jpg and photo-q80.webp.

Graphic (1200 x 750, with transparency)

EncodingBytesSize vs PNGPSNR
PNG, lossless15,909100%identical
WebP, lossless4,73230%identical
JPEG, quality 80 (alpha flattened to white)28,991182%37.6 dB
WebP, lossy quality 807,99050%38.2 dB
AVIF, quality 503,89224%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

FeatureJPEGPNGWebPAVIF
CompressionLossyLosslessLossy or losslessLossy or lossless
TransparencyNoYesYesYes
AnimationNoNo (APNG is separate)YesYes
Browser displayAllAllAll current (Safari 14+ on Big Sur+)Chrome 85+, Edge 121+, Firefox 93+, Safari 16.4+
Export from ImageWandYesYesIn browsers that can encode it (Chrome, Edge, Firefox)Only if your browser can encode it
Typical usePhotos, maximum compatibilityGraphics, screenshots, mastersWeb photos and graphicsWeb 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.

Sources

Platform rules change. These are the official pages this guide was checked against on . Always confirm the current rule before you submit.

  1. Image file type and format guide · MDN Web Docs · accessed
  2. AVIF image format · Can I use · accessed
  3. An image format for the Web (WebP) · Google for Developers · accessed
  4. Google image SEO best practices · Google Search Central · accessed
  5. HTMLCanvasElement: toBlob() method · MDN Web Docs · accessed

Frequently asked questions

Which image format is best for photos on a website?

MDN recommends WebP or AVIF for raster images, with JPEG as a widely compatible fallback for photographs. Use the picture element if you want to serve a modern format and keep a JPEG fallback.

Which format is best for logos, screenshots and diagrams?

Use SVG for logos and icons that have a vector version. For raster screenshots, diagrams and line art, use lossless encoding: PNG or lossless WebP.

Can ImageWand convert images to AVIF?

Only in browsers that can encode AVIF. The ImageWand converter offers AVIF output only when your browser's own canvas encoder really writes AVIF; it checks first and does not save a mislabeled file. Most current browsers can display AVIF but cannot encode it from a web page, so many visitors will not see the option. If you need AVIF reliably, use a dedicated encoder and keep a JPEG or WebP fallback.

Written by

ImageWand Team · Editorial Team

The ImageWand editorial team writes practical guides on image editing, file formats, compression, and platform-specific image requirements. Each guide lists the official sources we checked and when, and says plainly which steps ImageWand can and cannot do. About ImageWand