Best image format.

Knowing how to pick the right image format for a website is a crucial skill for us here at Themeisle. After all, we build WordPress themes and plugins for a living, so we should know which image formats to use in them. But the question is actually deeper and quite significant for all websites.

We wanted to investigate and give you a resource you could come back to whenever you wondered about image formats. We published the very first version of this analysis back in 2018, when the question was only between JPEG, PNG, and GIF. Since then, we’ve updated it a couple of times whenever a new image format came around and proved viable. First, we added WebP and then AVIF.

Here’s everything we’ve learned about the best image formats for any website and how they really work:

Key Takeaways

  • For decades, website owners had three main choices when it came to image formats: JPEG, PNG, and GIF. In recent years, the internet has evolved to adopt two new image formats: WebP and AVIF.
  • For photos → AVIF (smallest) or WebP (great balance), fallback to JPEG; for UI/logos/screenshots → PNG (or ideally SVG if vector).
  • For animations and transparency → use video (MP4/WebM) for most motion, animated WebP/AVIF for lightweight loops; reserve GIF for legacy only. PNG/WebP/AVIF handle transparency – JPEG doesn’t.

Why image formats matter

As we’ve mentioned, there are dozens of image formats to choose from. But when it comes to the web, most people stick to a handful of standbys: JPEG, PNG, GIF, and increasingly WebP and AVIF.

We’ll talk about what makes each of these image types unique in a moment. For now, let’s break down why the format(s) you use on your website matter in a more general sense.

The types of images you use affect your site’s:

  • Performance. Some image formats take up more space than others, which can affect your site’s loading times.
  • Appearance. As you might imagine, some image formats include greater detail for a higher-quality visual experience.
  • Scalability. When you stretch or shrink an image too much, its quality will suffer. How much leeway you have depends on the image format you use. This affects your site’s ability to look presentable on both large and small screens.
  • Compatibility: Sometimes you must use a certain image format based on the platform, app, or software used. WordPress.com supports seven formats for images (JPEG, PNG, GIF, WebP, SVG, HEIF and HEIC), but other platforms might only let you upload JPGs and PNGs. Furthermore, some devices and browsers prefer certain image formats, or even have their own proprietary formats, like HEIC on Apple devices.

In most cases, you’ll want to stick to using one or two image formats throughout your website. This helps maintain a consistent standard. The formats you choose should ideally provide a nice balance between quality and performance.

JPEG vs PNG vs GIF vs WebP vs AVIF in detail

Let’s look through the most popular image formats on the web and examine their pros and cons:

1. JPEG

JPEG stands for Joint Photographic Experts Group. The group formed in 1986, and the first JPEG standard was published in 1992.

In short, JPEG is a lossy image format made for photos.

Main benefits of JPEGs:

  • Supports millions of colors (24-bit color)
  • Compresses natural photos well (skin, skies, foliage)
  • Usually smaller than PNGs, which helps pages load faster (but note that modern formats like WebP/AVIF are usually smaller than JPEG at similar quality)
  • Works everywhere – browsers, apps, and devices
  • Easy to convert to other formats like PNG, WebP, or AVIF (though lost detail can’t be recovered)

In general, JPEG is an excellent option for displaying complex photographs that include a lot of color and texture. Here’s a quick example:

A colorful flower in JPEG format.

Compression can cause a slight quality drop, depending on how much you compress/optimize and if progressive encoding is used. You’ll mostly notice it on sharp edges or text, not in most photos.

Limitations (what JPEG isn’t great at):

  • No transparency (only a hard background workaround)
  • No animation
  • Artifacts on sharp edges, icons, or text
  • Usually larger than WebP or AVIF at the same quality
  • Limited to 8-bit color; no HDR or wide-gamut support
  • Loses more quality each time it’s re-saved

Best used for:

  • Photos and hero images needing wide support
  • Fallbacks when modern formats aren’t supported

Avoid for:

  • Logos, UI, diagrams, text, screenshots → use PNG, SVG, or WebP lossless
  • Transparency → use PNG, WebP, or AVIF
  • Animations → use MP4, WebM, or animated WebP/AVIF

What’s also a good practice is to remove extra EXIF or metadata unless needed (like orientation or copyright). This will make your image smaller in disk space. Further, when using JPGs on a website, remember to set width and height, and use lazy loading when you can.

👉 You can use Optimole to help you handle all of the optimizations mentioned above (it’s free for small sites).

In a nutshell, JPEG is still a reliable format for photos and backward compatibility. For new sites, AVIF or WebP usually offer smaller files, with JPEG as a universal fallback.

2. PNG

PNG stands for Portable Network Graphics. Like JPEG, it’s widely used on websites and supports millions of colors.

However, PNG works best for images with flat colors and sharp edges, such as UI elements, logos, diagrams, and screenshots. For photos, PNG files are usually much larger than JPEG, WebP, or AVIF.

Main benefits of PNGs:

  • Great for flat or low-color images (UI, diagrams, screenshots); often smaller than JPEG for these cases
  • Works everywhere – browsers, tools, and devices
  • Uses lossless compression, so pixels stay exact even after re-saving
  • Supports true alpha transparency for clean overlays and logos
  • Handles both indexed (palette) and truecolor (24-bit+) modes with no quality loss
  • Supports animation through APNG, useful for short UI loops that need transparency

Note: “PNG-8” (up to 256 colors) and “PNG-24” (truecolor) are tool labels, not official format names. PNG supports both palettes and truecolor, and some tools also allow 16-bit per channel PNGs for specific workflows.

Here’s an example of a PNG image:

WordPress dashboard

This is a screenshot of the WordPress dashboard. PNGs perform best on images with fast color transitions that need to stay sharp.

When taking a screenshot of a user interface, for instance, where elements shift quickly between dark and light backgrounds, PNG keeps everything crisp. Buttons and menu items – like in the example below – go from blue to black to white (text), then to gray in the dashboard area:

color transitions

Saving that same image as a JPEG could cause blurry edges and distortion.

PNG is also a great choice for logos and icons because it supports transparency. That allows clean cutouts and overlays. Here’s the Themeisle logo in PNG format with a transparent background:

Themeisle logo as PNG

Compressed PNGs also hold detail better thanks to their lossless compression method, unlike JPEG’s lossy approach.

Modern context and caveats:

  • For photos, PNG files are often 2–10× larger than JPEG, WebP, or AVIF. Use only when lossless quality is required.
  • Lossless WebP or AVIF can be smaller than PNG for some UI assets. Serve them with PNG as a fallback.
  • Use SVG for vector logos and icons – it’s smaller and scales cleanly.
  • “PNG-8” can be much smaller than truecolor PNG for flat-color designs.
  • Optimize PNGs with tools like Optimole or Imagify to reduce size without changing quality.
  • Use PNG for pixel art or 1-pixel-line graphics that must stay sharp; avoid lossy formats like JPEG or WebP.

PNG is the top choice for sharp graphics, transparency, and pixel-perfect detail. For photos or smaller files, test lossless WebP or AVIF and keep PNG as a reliable fallback.

3. GIF

Unlike the two formats we’ve talked about so far, Graphics Interchange Format (GIFs) have far more specific use cases. Although you can have a static GIF image, most people use this format to showcase animations, such as this one:

JPEGs and PNGs don’t generally support animations. That makes GIFs historically useful. As you can imagine, however, these types of images are rather large, since they contain multiple frames and only use an 8-bit color palette.

Main benefits of GIFs:

  • To explain a complex idea or action that requires some movement
  • Simple, auto-looping animations that play without user interaction
  • Broad compatibility (works in very old browsers, apps, and messaging clients)
  • They repeat over and over

You can optimize GIF files, but in most cases, the results won’t be as good as with other image formats. That means you should aim to use GIFs sparingly throughout your website, only when you need to showcase an animation you can’t create any other way (such as with CSS).

Furthermore, GIFs are not lighter than videos. Modern video codecs (H.264/MP4, VP9/AV1 in WebM) are far more efficient, often 5–20× smaller at similar visual quality.

On top of that, GIFs only support up to 256 colors and 1-bit transparency (no soft alpha). That makes them a poor choice for displaying complex images. To make that point even clearer, here’s the same graphic we showed you in the previous two sections, only now as a non-animated GIF:

Not only does it look terrible, but it’s a 825 KB file. This is why using GIFs for static images is generally not advisable.

Modern context and better alternatives:

  • For most animations, prefer video (.mp4/H.264 for widest support, or WebM/VP9/AV1) – smaller, smoother, and better color.
  • For sticker-like UI loops with transparency, consider animated WebP or animated AVIF; fall back to GIF for legacy.
  • For vector UI motion, consider CSS animations, SVG, or Lottie (tiny JSON + runtime).

If you must use GIFs:

  • Reduce dimensions and frame rate (e.g., 12–15 fps) to cut bytes.
  • Limit the palette and remove duplicate frames.
  • Use tools like Ezgif for extra savings.
  • Keep loops short; avoid photo-like content and gradients.

4. WebP

WebP is a newer image format that’s become popular as browsers added full support and Google started recommending it.

Introduced in 2010, WebP (often said “weppy”) supports both lossy and lossless compression, along with alpha transparency and animation, all in one format. It can produce smaller files than JPEG or PNG at similar visual quality.

WebP combines features from several formats: motion like GIF, transparency like PNG, and compression like JPEG. That makes it a flexible choice for the web and a solid option for anyone who wants smaller, high-quality images without switching between multiple formats.

Main benefits of WebP:

  • Smaller files than JPEG/PNG at similar quality; supports both lossy and lossless modes
  • Animation support, typically much more efficient than GIF and often smaller than APNG
  • Alpha transparency like PNG
  • Near-universal browser support today (≈95%+ global usage share; but keep JPEG/PNG fallbacks for the long tail/legacy tools)

With all that, it’s clear that the WebP file format holds promise for those adding images to websites. It provides the transparency potential of PNGs, motion possibilities of GIFs, and improved compression results when compared to older image file types like JPEGs and PNGs.

Still note that some solutions still prefer to store assets in PNG/JPEG, and then transcode to WebP at build/CDN time.

high resolution webp image of man blowing fire

As such, WebPs are used for:

  • Any graphic you want to display on the web (for print/offline workflows, stick with your original source formats)
  • Boosting performance/SEO by adopting modern image formats (use WebP/AVIF with JPEG/PNG fallbacks)
  • Creating logos or transparent UI assets with stronger compression potential than PNG (test lossless WebP vs PNG)
  • Making animated images without the bulk of GIF
  • Maintaining high visual quality at lower byte sizes than JPEG/PNG

The WebP file format functions well for interface screenshots (lossless), most photographic images (lossy), and lightweight animations. In many cases you’ll see substantial byte savings versus JPEG (and dramatic vs GIF/PNG), with comparable perceived quality.

Our advice for using the WebP file format is simple:

If your site builder allows WebP uploads, consider turning to it for more flexibility and compression power (and support for transparent images and animations). You shouldn’t have to worry much about browser compatibility, since the main players have already adopted it, and Google recognizes WebP as the image format of the future.

5. AVIF

AVIF (AV1 Image File Format) is built on the AV1 video codec and pushes image compression forward. It delivers great visual quality at a fraction of the size of older formats like JPEG and PNG.

You get both lossy and lossless options, full alpha transparency, and even animation in one format. That means crisp photos, smooth gradients, and clean overlays.

AVIF shines with detailed photos and images rich in color. It also supports HDR and wide-gamut color, giving more depth and realism. Still, not every browser or device renders it perfectly yet, so keeping an SDR fallback is a smart move.

Main benefits of AVIF:

  • Much smaller files than JPEG/PNG (and typically smaller than WebP) at comparable quality, which is great for your LCP/CLS
  • Broad browser support today (Chrome, Edge, Firefox, Safari); keep a JPEG/PNG fallback for the long tail and older tooling
  • Lossy + lossless, alpha transparency, and (emerging) animation in one format. Animated support exists but is less universally implemented than static AVIF
  • HDR/Wide Color Gamut capabilities for richer color where supported…expect some cross-browser differences in tone mapping
  • Future-proofed with AV1 coding, which is being adopted for video formats and is likely to become more prevalent

A few trade-offs to know:

  • Encoding/decoding can be heavier than WebP/JPEG; WebP often decodes faster on low-end devices even if AVIF is smaller. Balance bytes vs CPU.
  • Animation support and HDR behavior aren’t uniform across all browsers yet; test and provide safe fallbacks.
  • Some CMS/plugins and editors only recently added AVIF; most modern stacks handle it or can transcode at build/CDN time. WordPress 6.5 added AVIF support.

As more platforms embrace AVIF, adoption will continue to rise. Google also indexes AVIF images in Search, removing a past hesitation for SEO-conscious sites.

For experiment’s sake, I decided to upload a JPEG that was taken on a DJI drone to a free AVIF converter. It ended up reducing the file size from 1.3 MBs to an almost even 1 MB:

Visually, the quality remained really high. The only “downside” to the AVIF was that it was not as bright as the original JPEG file. The blues and greens were dulled down, but overall, I was impressed. You can see the comparison for yourself below:

In a nutshell, use AVIF for photos/hero images when you want the smallest bytes; pair with WebP for a speed/CPU balance and keep JPEG/PNG as a universal fallback.

How to choose the best image format to use on your website

So which is the best format for your situation?

It depends on what you’re using the image for:

  • Default for most images (photos and many graphics): use modern formats with fallbacks. AVIF (smallest files, supports transparency/animation, HDR-capable) or WebP (great size/speed balance, transparency/animation). Serve them with a JPEG/PNG fallback for older tools. If your CMS can transcode, keep originals (PNG/JPEG/SVG) and let the platform output AVIF/WebP automatically.
  • JPEG is best when you need broadest compatibility and fast decode for photographs. Great for galleries and hero photos where lossy compression is acceptable. Avoid for UI/screenshot/text (blurry edges) and for anything needing transparency or animation. Keep quality reasonable and consider progressive JPEG.
  • PNG is best for pixel-perfect UI, logos, icons, diagrams, screenshots, and true alpha transparency. Prefer for sharp edges and text; consider PNG-8 (palette) for flat art. For photos, PNG is usually much heavier than AVIF/WebP/JPEG, so avoid it unless you truly need lossless. If the asset is vector, SVG is even better.
  • GIF reserve for legacy or tiny, low-color loops only. For motion, prefer video (MP4/WebM) or animated WebP/AVIF. They’re far smaller and look better.

Conclusion on JPEG vs PNG vs GIF vs WebP vs AVIF

You have a lot of options when it comes to what types of image file formats you can use on your website. Ideally, you’ll pick whichever formats enable you to display high-quality images without slowing down your site too much.

If you’re a WordPress user, you’ll be glad to know that WordPress supports all the most popular image formats already.

Do you still have any questions about the best image format for your site? Let’s talk about them in the comments section below!

Yay! 🎉 You made it to the end of the article!

2 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
amin
2 years ago

what about avif?

Editor
1 year ago
Reply to  amin

It’s on the list now. Thanks for your feedback.