Image Optimization
Image optimization makes images load fast and be understood by search engines, using modern formats, compression, responsive sizes, alt text and lazy loading.
What is Image Optimization?
Image optimization is the practice of preparing images so they load as fast as possible without visible quality loss, keep layouts stable, and can be understood by search engines and assistive technologies. It combines technical steps (format, compression, sizing, lazy loading) with descriptive steps (alt text, file names and surrounding context).
Images are frequently the heaviest assets on a page and often the Largest Contentful Paint (LCP) element. Poorly optimized images are one of the most common reasons B2B marketing sites fail Core Web Vitals on mobile.
How it works
| Technique | What it does |
|---|---|
| Modern formats (AVIF, WebP) | Smaller files at similar quality |
| Compression | Removes unnecessary data |
Responsive images (srcset, sizes) | Serves the right size per device |
width and height attributes | Reserves space, preventing layout shift (CLS) |
loading="lazy" | Defers offscreen images |
fetchpriority="high" | Prioritizes the LCP image |
| CDN with image resizing | Delivers optimized variants close to users |
| Alt text and descriptive file names | Helps accessibility and image search |
A simple workflow:
- Export at the largest size actually displayed, not the original camera resolution.
- Convert to AVIF or WebP with a fallback if needed.
- Generate several widths and reference them in
srcset. - Set dimensions in HTML or CSS aspect ratios.
- Lazy load below-the-fold images; preload or prioritize the hero.
- Write alt text that describes the image’s purpose.
Examples
- A SaaS homepage serves a 3 MB PNG hero screenshot to mobile users. Converting it to a responsive AVIF set and adding
fetchpriority="high"greatly improves LCP. - A security blog’s diagrams have no alt text. Adding descriptions like “Diagram of a SIEM ingesting logs from endpoints and cloud services” improves accessibility and image search understanding.
- A landing page shifts as images load because dimensions are missing. Adding width and height removes the CLS.
Best practices
- Automate optimization in your CMS or build pipeline rather than relying on manual exports.
- Use SVG for logos and icons.
- Test key templates in PageSpeed Insights and check which element is the LCP.
- Use original screenshots and diagrams; they add information stock photos cannot.
- Keep important text in HTML, not baked into images.
Common mistakes
- Lazy loading the hero image.
- Uploading full-resolution images and scaling them down with CSS.
- Alt text like “image1” or keyword lists.
- Background CSS images for meaningful content, which Google may not index as images.
Related terms
Sources
- Google Images SEO best practices, Google Search Central
- Learn Images, web.dev
- Browser-level image lazy loading for the web, web.dev
Frequently asked questions
What is the best image format for the web?
For photos and complex graphics, AVIF and WebP usually give much smaller files than JPEG at similar quality, and both are supported by modern browsers. Use SVG for logos, icons and simple illustrations. Keep PNG for cases needing lossless quality where SVG is not an option.
Should I lazy load all images?
No. Lazy load images below the fold with loading="lazy", but do not lazy load the main above-the-fold image, especially if it is the Largest Contentful Paint element. Lazy loading the LCP image delays it and hurts Core Web Vitals. Consider fetchpriority="high" for that hero image.
How does alt text help SEO?
Alt text describes an image for screen reader users and when images fail to load. Google uses alt text, along with surrounding text and file names, to understand image content for Google Images and the page itself. Write a concise, accurate description; do not stuff keywords.