JA EN

Image Compression Benchmarks 2024 - JPEG, WebP, AVIF Measured Comparison

· About 9 min read

Benchmark Methodology - Conditions for Fair Comparison

Image compression format comparisons produce meaningless results without proper methodology. Claims like "AVIF is 50% smaller than JPEG" vary dramatically based on quality settings and image content. This benchmark establishes fair comparison conditions.

Comparison basis: Equal visual quality - We adjust each format's quality parameter (JPEG quality, WebP quality, AVIF CRF) to achieve identical SSIM (Structural Similarity Index) scores. Using SSIM 0.95 as the baseline, we compare the minimum file size each format requires to achieve this quality level.

Test image set: 5 categories × 20 images each = 100 total images. (1) Photographs (landscapes, portraits, food), (2) Illustrations/graphics (flat design, gradients), (3) Screenshots (text-heavy, UI), (4) Transparent images (product photos, icons), (5) High-frequency images (textures, fine patterns).

Encoders: JPEG uses libjpeg-turbo 3.0, WebP uses libwebp 1.3.2, AVIF uses libavif 1.0.4 (aom encoder). All are the latest stable versions as of 2024.

Encoding settings: JPEG - quality 60-95 range searching for SSIM 0.95. WebP - quality 50-90 range. AVIF - CRF 20-45 range, Speed 6. Binary search determines optimal quality per image, targeting SSIM 0.950±0.002. This methodology objectively answers: "at the same perceived quality, which format produces the smallest file?"

Photography Category Results - AVIF's Dominant Advantage

Photographs (natural images) are the category where image compression formats perform best. Continuous tones and gradients allow frequency-transform-based compression to function effectively.

Results summary (SSIM 0.95 baseline, median of 20 images):

AVIF achieves equivalent visual quality at less than half the file size of JPEG. WebP is 30%+ smaller than JPEG but the gap with AVIF is clear.

Resolution-dependent trends: AVIF's advantage increases with higher resolution. At 4000px width, AVIF compresses to 45% of JPEG, while 400px thumbnails only reach 55%. This is because AVIF's block size (up to 64x64) functions more efficiently with larger images.

Content-dependent trends: Landscape photos (sky gradients, distant detail) show AVIF's strongest performance at 42% of JPEG. Textured close-ups (fabric, wood grain) show reduced advantage at 55% of JPEG. Portraits achieve 47% of JPEG, with AVIF's prediction model effectively handling skin gradients.

Encoding time comparison: JPEG 1x (baseline), WebP 3-5x, AVIF 15-25x (Speed 6). AVIF's encoding time is a clear disadvantage, but acceptable for build-time batch processing where the compression savings justify the computational cost.

Illustration and Screenshot Category Results

Illustrations and screenshots have different characteristics from photographs. Sharp edges, uniform color areas, and text create content with mixed high-frequency and low-frequency components.

Illustrations/Graphics (SSIM 0.95 baseline, median of 20 images):

AVIF's advantage expands further in the illustration category. JPEG produces visible block boundary artifacts requiring high quality settings to achieve SSIM 0.95. AVIF's larger block sizes and advanced prediction models compress uniform color areas with extreme efficiency.

Screenshots (SSIM 0.95 baseline, median of 20 images):

Screenshots are AVIF's strongest category. It maintains text sharpness while compressing uniform background areas to their theoretical minimum. The 70% reduction versus JPEG is remarkable.

Important note: When lossless compression is required for illustrations or screenshots, PNG remains the most compatible choice. WebP lossless is 26% smaller than PNG, and AVIF lossless is 10-15% smaller still, but considering browser support rates, PNG + WebP fallback remains the safe approach for maximum compatibility.

Transparent and High-Frequency Image Results

Images with transparency (alpha channels) and high-frequency content (textures) require particular attention in format selection.

Transparent images (SSIM 0.95 baseline, including alpha, median of 20 images):

The migration effect from PNG is dramatic for transparent images. E-commerce product photos (white background made transparent) typically see 500KB PNGs become 90KB in WebP and 60KB in AVIF. A page with 100 product images reduces from 50MB to 6MB (AVIF) - transformative for page load performance.

High-frequency images (textures, fine patterns, SSIM 0.95 baseline):

High-frequency images are "difficult" for all formats. Fine patterns and textures resist prediction, reducing compression efficiency. AVIF still achieves 42% reduction versus JPEG - less dramatic than other categories but clearly advantageous.

Notable finding: When AVIF quality is pushed too low (CRF 40+) on high-frequency images, "smearing" occurs - detail loss from overly aggressive deblocking filters. For texture photography, limit CRF to 25-30. WebP doesn't exhibit this issue as severely, making it preferable for texture preservation in some scenarios.

Encoding Speed and Decoding Speed Comparison

Beyond file size, encoding and decoding speed are critical format selection factors. Real-time conversion requirements and client-side decode performance directly impact user experience.

Encoding speed (1200x800px photo, equal quality baseline):

AVIF encoding takes nearly 20x longer than JPEG. Processing 1,000 images: JPEG takes 15 seconds, AVIF (speed 6) takes approximately 5 minutes. Acceptable for CI/CD pipelines but unsuitable for real-time conversion on user upload.

Decoding speed (browser rendering):

AVIF decoding takes approximately 2x longer than JPEG. The 10ms per-image difference is negligible individually, but pages with 50+ images may see cumulative impact. Using decoding="async" minimizes main thread impact.

Memory usage: Peak memory during AVIF decoding is approximately 1.5x that of JPEG. On memory-constrained mobile devices (budget Android phones), simultaneously decoding many AVIF images may cause memory pressure. Consider lazy loading strategies to limit concurrent decode operations on resource-constrained devices.

Format Selection Guidelines Based on Benchmark Results

Based on measured data, here are format selection guidelines by image type and use case.

Recommended format selection matrix:

Cost-benefit judgment: Considering AVIF adoption costs (build pipeline changes, increased encoding time, fallback management), migrate in this priority order: (1) Transparent images (PNG → WebP/AVIF for maximum reduction), (2) Hero/LCP images (direct LCP improvement), (3) All photographs (large cumulative effect from volume), (4) Illustrations/screenshots (lower priority if WebP already sufficient).

Final decisions should be based on your site's image composition and user browser distribution. If AVIF support exceeds 90% of your user base, comprehensive AVIF migration is fully justified by the bandwidth and performance gains demonstrated in these benchmarks.

Related Articles

Lossless vs Lossy Compression - How to Choose the Right Image Compression

Compare lossless and lossy compression mechanisms, characteristics, and use cases to choose the optimal compression method for your images.

Deep Dive into Image Compression Algorithms - DCT, Wavelet Transform, and Predictive Coding

In-depth explanation of core image compression technologies. Understand the mathematical principles behind JPEG's DCT, JPEG 2000's wavelet transform, H.265/AV1 predictive coding, and entropy coding.

AVIF Adoption Guide - Browser Support, Fallback Strategies, and Implementation

A practical guide to adopting AVIF format. Covers browser compatibility, picture element fallbacks, optimal encoding settings, and build pipeline integration.

WebP to AVIF Migration Decision - Cost-Benefit Analysis and Implementation Strategy

Decision framework for migrating from WebP to AVIF. Covers additional compression gains, migration costs, and phased implementation strategies with concrete data.

The Future of Image Formats - How JPEG XL and WebP2 Will Transform the Web

Compare the technical features and future potential of next-gen image formats including JPEG XL, WebP2, and AVIF. Detailed analysis of compression performance, browser support, and migration strategies.

Image Format Comparison - JPEG/PNG/WebP/AVIF/GIF/BMP Features and Use Cases

Compare technical characteristics of 6 major image formats. Organized comparison of compression methods, color depth, transparency, animation, and browser support with optimal format selection by use case.

Related Terms