On-Page SEO

Image SEO: alt text, formats, compression, and lazy load

Image SEO: alt text, formats, compression and lazy load

Images are the second most common source of organic traffic after text search. Proper alt text, modern formats, compression, and lazy loading directly affect rankings, Core Web Vitals, and visibility in Google Images.

Google Images processes billions of queries every month. According to Jumpshot data, around 22% of all web searches involve image search. For e-commerce sites, content platforms, and portfolios this is a substantial traffic channel that most sites completely ignore.

Image optimisation affects not only visibility in Google Images but also organic search: page load speed (LCP), Core Web Vitals, user experience, and — indirectly — rankings in the main SERP.

The image SEO pipeline: format, srcset, lazy load, alt and Image Sitemap — five steps from a heavy JPG to a fast picture in search.
Images without alt text are invisible to Google. The search engine cannot 'read' a picture — it reads metadata, surrounding context, and the alt attribute. Without these, the chance of appearing in Google Images is close to zero.

Why optimise images for SEO

Proper image optimisation solves several problems at once: it improves site accessibility for visually impaired users, speeds up page loading, gives Google clear context, and opens an additional organic traffic channel through Google Images.

Five steps for optimizing images for search engines.
22%

Search share

Of all search queries involve image search

21%

LCP reduction

Average improvement from switching JPEG to WebP at the same visual quality

~60%

Page weight

On average, images account for the largest share of page weight

Conversion

Sites with optimised images convert better due to faster load times

Images are the heaviest resource type on most pages. Unoptimised images slow loading, degrade LCP (Largest Contentful Paint), and directly affect Core Web Vitals scores. Since 2021, Google has included CWV as a ranking signal.

Alt text: writing rules

The alt attribute (alt="...") is the only way to explain to Google what is shown in an image. It also displays when an image fails to load, and is read aloud by screen readers for visually impaired users.

How to write it correctly

BadGood
image.jpgOrganic traffic growth chart for 2024–2025
photo1Google Search Console coverage report screenshot
SEO SEO SEO keywordsStep-by-step hreflang setup diagram for multilingual sites
logoseohead.tech company logo
(empty alt for an important image)Brand query rankings chart over 6 months

Alt text rules: describe what is visible in the image; include the target keyword naturally if relevant; do not begin with phrases like 'image of...', 'photo of...', 'picture of...' — Google already knows it is an image. Optimal length: 5–15 words.

Decorative images (dividers, background textures, meaningless icons) should have an empty alt attribute: alt="". This signals to screen readers to skip the image, which is correct from an accessibility standpoint.
HTML
<!-- Informative image -->
<img
  src="/images/crawl-budget-chart.webp"
  alt="Crawl budget distribution chart by page type"
  width="800"
  height="450"
/>

<!-- Decorative image -->
<img
  src="/images/divider.svg"
  alt=""
  role="presentation"
/>

<!-- Image link: alt describes the link purpose -->
<a href="/tools">
  <img
    src="/images/seo-scripts-icon.webp"
    alt="SEO Scripts: tools for technical audits"
    width="64"
    height="64"
  />
</a>

File names and paths

Google analyses the image filename as an additional signal. The name DSC_0047.jpg provides no information; canonical-url-diagram.webp signals the topic and context.

Bad nameGood name
DSC_0047.jpgseo-audit-checklist.webp
image001.pnggoogle-search-console-coverage-report.webp
photo.jpeginternal-linking-architecture-diagram.webp
img_final_v3_FINAL.pngrobots-txt-structure.webp
Use only lowercase letters, numbers, and hyphens in filenames. Avoid spaces (encoded as %20), underscores, and special characters. A path like /images/blog/ is more structured than /uploads/2024/05/.

Formats: WebP, AVIF, JPEG, PNG

Format selection is one of the key optimisation factors. Modern formats (WebP, AVIF) deliver significantly smaller file sizes at the same visual quality.

FormatCompressionTransparencyAnimation
WebP25–35% better than JPEGYesYes
AVIF50% better than JPEGYesYes
JPEGBaselineNoNo
PNGWorse than JPEGYesNo
SVGVectorYesYes
GIFPoorLimitedYes
Browser support and recommendations:
FormatSupportRecommendation
WebP97%+Primary format for photos and screenshots
AVIF90%+Best quality, slightly slower decoding
JPEG100%Fallback for older browsers
PNG100%Only for icons and text-heavy screenshots
SVG97%+Icons, logos, diagrams
GIF100%Replace with WebP or video

Recommended strategy: use WebP as the primary format with a JPEG fallback via the <picture> element. Move to AVIF once your audience is predominantly on Chrome 85+ and Safari 16+. SVG for all vector graphics without exception.

HTML
<!-- Modern approach: AVIF → WebP → JPEG -->
<picture>
  <source srcset="/images/hero.avif" type="image/avif" />
  <source srcset="/images/hero.webp" type="image/webp" />
  <img
    src="/images/hero.jpg"
    alt="SEO audit of an online store: 340% traffic growth"
    width="1200"
    height="675"
    loading="eager"
    fetchpriority="high"
  />
</picture>

Compression without quality loss

Most images can be compressed by 30–70% with no visible quality loss. Key tools: Squoosh (online), ImageMagick (CLI), Sharp (Node.js), Pillow (Python).

Optimal quality settings

FormatWeb qualityTool
WebP75–85Sharp: sharp().webp({ quality: 80 })
AVIF60–75Sharp: sharp().avif({ quality: 65 })
JPEG75–85ImageMagick: -quality 80
PNGLosslesspngquant: --quality=65-80
Code implementation example:
JAVASCRIPT
// Next.js: automatic optimisation via next/image
import Image from 'next/image';

// next/image automatically:
// - converts to WebP/AVIF
// - generates srcset
// - adds lazy loading
// - prevents layout shift (requires width/height)
export function HeroImage() {
  return (
    <Image
      src="/images/hero.jpg"
      alt="Organic traffic growth after SEO audit"
      width={1200}
      height={675}
      priority // disables lazy load for the hero image
    />
  );
}
In Next.js, use the <Image> component instead of <img>. It automatically converts to WebP/AVIF, generates srcset, and prevents layout shift. For above-the-fold hero images, always add priority — this reduces LCP.

Lazy load and loading='eager'

Lazy loading defers the loading of off-screen images until the user scrolls to them. This reduces the initial page weight and speeds up Time to Interactive.

HTML
<!-- Below-fold images: lazy loading -->
<img
  src="/images/article-thumbnail.webp"
  alt="XML sitemap audit screenshot"
  width="400"
  height="225"
  loading="lazy"
/>

<!-- Hero and LCP images: eager + fetchpriority -->
<img
  src="/images/hero.webp"
  alt="Real-time SEO analytics"
  width="1200"
  height="675"
  loading="eager"
  fetchpriority="high"
/>
Format parameter comparison:
AttributeValueWhen to use
loadinglazyAll images below the first viewport
loadingeagerHero, logo, LCP element
fetchpriorityhighMain image on the page (LCP)
fetchprioritylowDecorative images at the bottom of the page
decodingasyncMost images — does not block rendering
Never add loading="lazy" to the LCP image — this is a critical mistake. The browser will defer loading the most important visual element on the page, causing LCP to spike.

Dimensions, srcset and art direction

Always specify width and height attributes. This lets the browser reserve space for the image before it loads and prevents Cumulative Layout Shift (CLS) — content jumping during load.

HTML
<!-- srcset: different sizes for different screens -->
<img
  src="/images/blog-cover.webp"
  srcset="
    /images/blog-cover-480.webp 480w,
    /images/blog-cover-800.webp 800w,
    /images/blog-cover-1200.webp 1200w
  "
  sizes="(max-width: 480px) 480px, (max-width: 800px) 800px, 1200px"
  alt="Internal linking architecture guide: site structure diagram"
  width="1200"
  height="675"
  loading="lazy"
/>

The srcset attribute lets the browser select the optimal image size for the current screen and pixel density. On a mobile device with 2x DPI the browser loads the 800px version instead of 1200px — saving bandwidth and improving speed.

Structured data

Schema.org markup helps Google show images in rich results: product cards, recipes, articles. The most relevant types for images are ImageObject, Article, Product, and Recipe.

JSON
{
  "@context": "https://schema.org",
  "@type": "Article",
  "headline": "Image SEO: complete guide",
  "image": {
    "@type": "ImageObject",
    "url": "https://seohead.tech/images/blog/image-seo.webp",
    "width": 1200,
    "height": 675,
    "caption": "Image optimisation for search: formats, alt text, compression"
  },
  "datePublished": "2026-05-17",
  "author": {
    "@type": "Person",
    "name": "Pavel Barushka"
  }
}

Image sitemap

Google recommends including image information in your XML sitemap — this helps index images loaded via JavaScript and provides additional context (title, caption, licence).

XML
<?xml version="1.0" encoding="UTF-8"?>
<urlset
  xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
  xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
>
  <url>
    <loc>https://seohead.tech/blog/image-seo</loc>
    <image:image>
      <image:loc>https://seohead.tech/images/blog/image-seo.webp</image:loc>
      <image:title>Image SEO: alt text, formats, compression, and lazy load</image:title>
      <image:caption>Complete guide to image optimisation for search</image:caption>
    </image:image>
  </url>
</urlset>
An image sitemap is especially important for images loaded via JavaScript (React, Vue, Next.js). Googlebot does not always execute JS during crawling, so the sitemap is a reliable way to ensure images are indexed.

FAQ

Yes, but indirectly. Alt text helps Google understand the topic of the page and image. A well-written alt with the target keyword strengthens page relevance, but keyword stuffing in alt attributes is treated as spam.
AVIF delivers better compression (20–30% more efficient than WebP) but has slightly lower browser support and slower decoding on low-end devices. The optimal setup is AVIF → WebP → JPEG via <picture>. For most projects, WebP is a reliable choice right now.
No. Decorative images (backgrounds, dividers, meaningless icons) do not need to be indexed. Leave an empty alt="" — this is a signal to Google to skip the image during indexing. Focus on content images: screenshots, diagrams, product photos.
Open Google Search Console → 'Indexing' → 'Pages'. For a specific image: type site:your-domain in Google Images and check for your images. Also use the URL Inspection tool in GSC and confirm images are accessible to Googlebot (not blocked in robots.txt).
Yes — to prevent CLS (Cumulative Layout Shift). Without these attributes the browser does not know the image dimensions before it loads, causing content to jump. CLS directly affects Core Web Vitals scores and has been a ranking signal since 2021.