Back to blog
    Header image for the article "Image Optimization: WebP, AVIF, and Lazy Loading"
    Optimization02/05/20265 min

    Image Optimization: WebP, AVIF, and Lazy Loading

    Want to know how your own site is doing?

    Images account for 50–70% of total page weight. Correct optimization can make your website three times faster.

    Author: Kodulehehaldus

    Why Images Matter

    The average website is 2.5MB in size, with 1.5–2MB consisting of images. Every megabyte represents an additional cost to the visitor (especially on mobile) and slows down the page.

    Choosing the Right Format

    FormatUsageAdvantage
    WebPUniversal30% smaller than JPEG, supported by 96% of browsers
    AVIFThe Future50% smaller than JPEG, 90% support
    JPEGLegacy StandardWorks everywhere
    PNGTransparencyLarge file size; use only for logos/icons
    SVGVector GraphicsScales infinitely, small file size

    The Rule: Correct Sizing

    • Full-width hero image: max 1920px wide
    • Content image: max 1200px wide
    • Thumbnail: max 600px wide
    • Avatar: max 200px

    Never upload a 4000px wide image if it is displayed at 800px.

    Compression Levels

    • JPEG: 75–85% quality is optimal
    • WebP: 75–80%
    • AVIF: 50–65% (already provides excellent results)

    Tools

    Free:

    • TinyPNG / TinyJPG (web-based)
    • Squoosh (Google's tool)
    • ImageOptim (Mac)
    • ShortPixel (WordPress plugin, 100 images free/month)

    Paid:

    • Imagify, ShortPixel premium
    • Cloudinary (CDN + transformation)

    Lazy Loading

    Add this to all below-the-fold images:

    <img src="..." loading="lazy" width="800" height="600" alt="...">

    WordPress 5.5+ handles this automatically.

    Responsive Images

    Provide the browser with choices for the correct size:

    <img srcset="img-400.webp 400w, img-800.webp 800w, img-1200.webp 1200w"
         sizes="(max-width: 600px) 400px, 800px"
         src="img-800.webp" alt="...">

    Summary

    Image optimization is the fastest way to improve page speed. One hour of work can reduce page weight by up to 70%.

    Join the newsletter

    Once a month, practical tips on making your website faster, more secure and easier to find on Google and in AI search.

    By subscribing you receive our newsletter. You can unsubscribe at any time from the end of every e-mail. Privacy policy

    Author

    Kodulehehaldus.com (Innov8it OÜ) – an Estonian web agency that builds, maintains and optimises websites.

    Related articles