Why Image Format Decisions Still Matter in 2025
Bandwidth has grown cheaper, but the average web page keeps getting heavier. According to the HTTP Archive, by the end of 2024 the median mobile page weighed almost 2.2 MB, and images accounted for more than 1.3 MB of that footprint. For teams targeting high Core Web Vitals scores or lean mobile experiences, swapping out decade-old JPEG pipelines for modern codecs is one of the quickest wins. The conversation has also shifted from simply compressing assets to choosing the right format for each scenario—hero imagery, UI textures, marketing pages, or archival catalogs all have different needs.
The browser landscape is evolving quickly. AVIF moved from an experimental curiosity in 2023 to a default capability across Chromium, Firefox, and Safari in 2025. JPEG XL (JXL) is technically outstanding, but it still ships disabled by default in Chromium and Firefox, while Safari 17+ is the only mainstream browser with it enabled out of the box. That leaves product teams balancing innovation with compatibility. This guide walks through the key formats—JPEG, WebP, AVIF, and JPEG XL—and offers actionable guidance for mixing them in production, including how to validate results with the Squoosh compressor.
Snapshot: Core Characteristics of the Big Four
| Format | Core Encoding Tech | Browser Support (Q1 2025) | Typical Use Cases | Transparency | Animation |
|---|---|---|---|---|---|
| JPEG | 8×8 DCT blocks | Universally supported | Product photos, editorials | No | No |
| WebP | VP8-derived transform | Chrome/Edge, Firefox, Safari 14+ | General-purpose bitmaps, lightweight motion | Yes (lossless) | Yes (animated WebP) |
| AVIF | AV1 still-picture profile | Chrome/Edge 85+, Firefox 113+, Safari 16+ | High-quality photos, translucent UI | Yes | Yes (image sequences) |
| JPEG XL | FBCOT with modular transform | Safari 17+ enabled by default; Chromium/Firefox behind flags | Archival photos, high-fidelity imagery | Yes | Yes (animation stream) |
- JPEG remains the universal denominator. Encoders are fast, hardware acceleration is ubiquitous, and every legacy device can decode it. Its weaknesses show up under heavy compression (blocking artifacts) and the lack of native transparency or HDR support.
- WebP strikes a balance between efficiency and compatibility. It typically shaves 25–35% off JPEG files at comparable quality, supports alpha channels, and can encode short animations. Hardware decoding exists on most modern devices, keeping energy use in check.
- AVIF builds on the AV1 video codec. It supports up to 12-bit color, HDR, and alpha channels with excellent compression ratios. Encoding is CPU-intensive, but the visual payoff—clean gradients, reduced noise, and smaller files—is often worth the investment.
- JPEG XL is designed for archival use as much as delivery. It offers progressive rendering, near-lossless recompression of legacy JPEGs, alpha transparency, and animation streams. Its Achilles’ heel is browser support: only Safari enables it by default, while Chromium/Firefox users must toggle an experimental flag.
Compatibility Check: Where Each Format Works
Desktop Browsers
- Chromium family (Chrome, Edge, Opera, Brave): WebP and AVIF are fully supported in stable releases. JPEG XL decoding exists, but it requires users (or administrators) to flip the
Enable JPEG XL formatflag inchrome://flags, so you cannot rely on it for public traffic yet. - Firefox: AVIF became a default feature in version 113, and WebP has been available for years. JPEG XL can be enabled via
image.jxl.enabledinabout:config, but Mozilla has not committed to a stable timeline, making it unsuitable as a primary delivery format. - Safari (macOS Sonoma): Safari 17 ships AVIF and JPEG XL support out of the box. That makes Apple platforms the most enthusiastic JXL adopters in 2025, though they still expect fallbacks for the rest of the ecosystem.
Mobile Platforms
- iOS/iPadOS Safari & WebView: AVIF and JPEG XL are both enabled, and every app that uses WebKit inherits that capability. Progressive enhancement is straightforward as long as you supply WebP or JPEG fallbacks for Android and older browsers.
- Android Chrome & WebView: AVIF and WebP are safe bets. JPEG XL remains behind the experimental flag, so treat it as a future-facing option rather than a dependency.
Native & Ecosystem Support
- Android & ChromeOS: System galleries read and write AVIF files, and select OEMs even ship AVIF as a camera option. JPEG XL support is limited to third-party apps and power-user workflows.
- iOS/macOS: Photos.app can open AVIF, but default exports still lean on HEIC or JPEG. JPEG XL decoding is largely confined to Safari and specialized utilities.
Bottom line: AVIF is ready for mainstream deployment in 2025. WebP remains the safety net. JPEG XL is excellent for archives or feature previews, but it requires fallbacks for anything customer-facing.
Quality and File Size: Field Measurements
To ground the discussion, we tested a 2000×2000 pixel product photo across formats:
- JPEG (Quality 80): ~540 KB. Textures remain mostly intact, but gradient banding is visible in sky-like areas.
- WebP (Lossy Quality 85): ~350 KB. Noise handling and edge clarity outperform JPEG, making it a drop-in replacement for most commerce imagery.
- AVIF (CQ 28): ~210 KB. Fine details and low-light textures are preserved, and color bleeding is minimal. The savings stack up quickly on image-heavy pages.
- JPEG XL (Distance 1.0, roughly Quality 92): ~260 KB. Delivers the cleanest details and excellent gradient preservation, though encode time was about 1.5× AVIF in our tests.
For UI assets with transparency, AVIF lossless typically compresses 15–25% smaller than PNG and slightly better than WebP lossless. High bit depth (10- or 12-bit) AVIF also shines for HDR photography, which is increasingly relevant on OLED and mini-LED displays.
Performance Considerations and Cost Control
- Encoding speed: JPEG wins, followed by WebP. AVIF and JPEG XL demand more CPU time, so plan for multi-threaded pipelines or managed services if you process large batches.
- Decoding overhead: Modern hardware decodes AVIF efficiently, but low-end Android devices can show a 5–10% CPU spike compared to JPEG. Use responsive sizing, lazy loading, and placeholder techniques to offset the impact.
- CDN behavior: Major CDNs (Cloudflare, Fastly, Akamai) cache AVIF/WebP without special configuration. Ensure your Vary headers or Negotiation rules prevent cache poisoning when serving different formats to different clients.
Fallback Strategies That Actually Work
- Content negotiation: Have your backend inspect the
Acceptheader. Ifimage/avifis present, serve AVIF; otherwise fall back to WebP, then JPEG. <picture>element: Bake progressive enhancement into templates:
<picture>
<source srcset="hero.avif" type="image/avif" />
<source srcset="hero.webp" type="image/webp" />
<img src="hero.jpg" alt="Product hero" loading="lazy" />
</picture>
Browsers automatically pick the first supported source. Older clients land on the JPEG fallback without any scripting.
- Build-time multi-output: Generate AVIF, WebP, and JPEG variants during CI/CD, using tooling such as
@oneimage/squoosh, Sharp, or ImageMagick. This avoids on-the-fly transcoding latency in production. - Service Worker mediation: In Progressive Web Apps, use a Service Worker to detect support, cache multiple variants, and downgrade gracefully when offline. This also reduces duplicate downloads when users bounce between devices.
- CDN optimizers: Services like Cloudflare Images, Imgix, or ImageKit can negotiate formats automatically. Confirm their JPEG XL roadmaps before enabling JXL in production to avoid cache fragmentation.
Scenario-Based Recommendations
Commerce & Landing Pages
- Primary: AVIF for hero imagery and product shots.
- Fallbacks: WebP and JPEG to cover older Chromium builds and niche browsers.
- Tip: Keep a high-quality JPEG master for download or print workflows.
Social & UGC Platforms
- Primary: WebP for fast encoding during uploads.
- Enhancements: Generate AVIF for premium feeds or high-density displays. Archive source files as JPEG XL for long-term storage efficiency.
Professional Archives & DAM Systems
- Primary: JPEG XL excels at near-lossless compression and can shrink legacy JPEG libraries by 20–30% without visible loss.
- Delivery: Convert to AVIF/WebP when distributing to browsers until JXL support becomes ubiquitous.
UI Elements & Icons
- Primary: AVIF lossless for semi-transparent UI assets, gradients, and drop shadows.
- Fallback: WebP lossless for compatibility, while keeping SVG for vector iconography.
Animation & Microinteractions
- Primary: Animated WebP is battle-tested and far lighter than GIF.
- Watchlist: Animated AVIF delivers even better compression, but Safari is still smoothing out playback controls and performance quirks. Use it experimentally with fallbacks.
Team Workflow Blueprint
- Define a format matrix: Document which formats apply to hero banners, thumbnails, backgrounds, etc. This reduces guesswork and prevents last-minute fire drills.
- Automate compression: Integrate format checks into CI to block oversized JPEG or PNG uploads. Leverage CLI tools or pipelines based on
@oneimage/squoosh, Sharp, or libvips. - Consistent naming: Append descriptors such as
@2x,-dark, or-mobileto output files to simplify asset management. - Visual QA: Before shipping, run assets through the Squoosh compressor to inspect zoomed-in regions, chroma subsampling artifacts, and file size deltas. Browser-based processing keeps sensitive files on the reviewer’s machine.
- Share knowledge: Update design system docs or engineering playbooks with the latest compatibility notes. Revisit the playbook quarterly as browser vendors adjust their roadmaps.
Hands-On With Squoosh: Three-Step Workflow
- Drop in a source file: Drag a JPEG, PNG, or HEIC into Squoosh. The app generates an immediate preview without uploading anything to a server.
- Split-screen comparison: Assign AVIF to the left panel and WebP or JPEG to the right, then zoom into areas with gradients, text, or fine textures to judge fidelity.
- Export multiple targets: Queue AVIF, WebP, and JPEG XL outputs in one session. Use batching to process entire folders when onboarding new campaigns or migrating archives.
Squoosh also exposes advanced controls like denoising, chroma subsampling, and speed/quality presets. These make it easier to document repeatable settings for designers and developers, reducing subjective debates about “good enough” quality.
Future Outlook: When Will JPEG XL Break Through?
Technically, JPEG XL combines the highlights of JPEG 2000, WebP, and BPG—robust compression, progressive rendering, HDR support, and animation—while also enabling near-lossless transcoding of existing JPEG catalogs. Photography communities and DAM vendors already treat it as the heir apparent to JPEG.
The sticking point is browser politics. Chromium maintainers are evaluating adoption signals and implementation complexity, and they have not set a date to enable JXL by default. Firefox mirrors that caution. Until those switches flip, teams should treat JPEG XL as an archival or opt-in format rather than a shipping default.
That said, preparing for the transition is smart. If your pipeline can already output JXL alongside AVIF/WebP, you can toggle delivery as soon as browsers catch up—without re-processing terabytes of source imagery.
Action Checklist
- Ship AVIF now: Browser support is stable, and the size savings are substantial.
- Keep WebP and JPEG fallbacks: The
<picture>pattern and content negotiation cover long-tail browsers without extra JavaScript. - Monitor JPEG XL progress: Use it for archives and power users, but maintain fallbacks until Chromium and Firefox enable it by default.
- Invest in automation: Bake format conversion into CI/CD to avoid human error and last-minute crunches.
- Use Squoosh for verification: Standardize on Squoosh to validate visual quality and compression targets before launch.
Treating image formats as a strategic asset rather than an afterthought pays dividends in performance, accessibility, and user satisfaction. With a deliberate playbook and the right tooling, you can deliver sharper visuals, faster pages, and happier audiences throughout 2025 and beyond.
