SammaPix
Back to Blog
SEO··10 min read

Image SEO: The Complete Guide to Optimizing Images for Google (2026)

A complete image SEO guide — filenames, alt text, structured data, page speed, and Google Image Search. Everything you need to rank your images.

What is image SEO?

Image SEO is the practice of optimizing images so search engines can understand, index, and rank them. It encompasses two related but distinct goals:

  • Image Search rankings — appearing in Google Image Search for relevant queries
  • Page SEO — images that load fast and are well-described contribute to overall page rankings through Core Web Vitals and content relevance signals
  • In practice, image SEO means: using the right filenames, writing quality alt text, compressing images for speed, using structured data where relevant, and ensuring images are crawlable.

    Why image SEO matters more than most people think

    Image search accounts for 22.6% of all web searches (SparkToro, 2024). For categories like food, fashion, interior design, travel, and e-commerce, the percentage is much higher. If you're not optimizing images, you're invisible to a quarter of search traffic.

    Beyond Image Search, images affect page SEO through:

  • Core Web Vitals (LCP) — The Largest Contentful Paint metric measures how long it takes for the largest visible content element to load. For most pages, this is a hero image. A 2-second improvement in LCP can meaningfully improve rankings.
  • Content relevance — Google's vision models can analyze image content. Images that are relevant to the surrounding text reinforce the page's topical authority.
  • Crawl efficiency — Properly implemented images (with width/height attributes, correct src values) are easier for Googlebot to index efficiently.
  • 1. Image filenames

    The filename is the most direct signal Google has about an image's content before analyzing the visual data. Use it.

    Rules:

  • Lowercase only
  • Words separated by hyphens (not underscores, not spaces)
  • 3–6 words, 8 maximum
  • Describe the specific subject: what's in the image
  • Include your target keyword where it fits naturally
  • No generic names: no img001, DSC_0042, photo, image, screenshot
  • Examples:

  • `golden-retriever-puppy-grass.jpg` ✓
  • `DSC_0042.jpg` ✗
  • `dog.jpg` ✗ (too vague)
  • `my-cute-golden-retriever-puppy-playing-in-the-green-grass-park.jpg` ✗ (too long, keyword-stuffed)
  • At scale, manual renaming is impractical. SammaPix's AI Rename generates SEO-optimized filenames automatically using Google Gemini to analyze each image. It produces filenames and alt text in the correct format with one click per file.

    2. Alt text

    Alt text (the alt attribute on <img> tags) serves two purposes: accessibility for screen reader users, and an additional content signal for search engines.

    Rules:

  • Write a descriptive sentence (not a filename)
  • Include the target keyword once if it fits naturally — never force it
  • Keep under 125 characters
  • Don't start with "Image of..." or "Photo of..."
  • Decorative images use empty alt: `alt=""`
  • Be specific: "A barista pouring steamed milk creating a heart pattern in a latte" is better than "coffee"
  • What Google says: Google uses alt text to understand image content and context. It's particularly important for Google Image Search — images with descriptive alt text rank higher for relevant queries.

    Implementation:

    ```html

    <!-- Good -->

    <img src="barista-latte-art-heart.webp" alt="Barista pouring steamed milk to create a heart-shaped latte art design">

    <!-- Bad -->

    <img src="barista-latte-art-heart.webp" alt="coffee shop barista latte art coffee espresso milk">

    <!-- Bad -->

    <img src="image1.jpg" alt="image">

    <!-- Decorative (correct) -->

    <img src="divider.svg" alt="">

    ```

    3. Page speed and Core Web Vitals

    Image load time is the single biggest factor in LCP (Largest Contentful Paint) for most pages. LCP is one of Google's three Core Web Vitals and a confirmed ranking factor.

    Key optimizations:

    Format: Use WebP as your primary format. WebP is 25–35% smaller than JPEG at equivalent quality. For hero images, consider AVIF (30–50% smaller than WebP) with a WebP fallback.

    Compression: Quality 80 is the standard for most web images. This produces 60–70% size reduction with imperceptible quality loss.

    Dimensions: Always serve images at (or close to) their display dimensions. Serving a 4000px image in a 800px container wastes 25x the bandwidth.

    Lazy loading: Images below the fold should be lazy-loaded. The exception: hero images and above-the-fold images should NOT be lazy-loaded (they need to load immediately for LCP).

    ```html

    <!-- Above fold: no lazy loading -->

    <img src="hero.webp" alt="..." width="1200" height="630" fetchpriority="high">

    <!-- Below fold: lazy load -->

    <img src="article-image.webp" alt="..." width="800" height="500" loading="lazy">

    ```

    Width and height attributes: Always declare them. This prevents layout shift (CLS), another Core Web Vitals metric. Browsers need to know the aspect ratio before the image loads to reserve the correct space.

    4. Structured data for images

    Structured data (schema.org markup) helps Google understand the context of your images and can trigger enhanced search results (rich snippets, image carousels, product panels).

    ImageObject schema:

    ```json

    {

    "@context": "https://schema.org",

    "@type": "ImageObject",

    "url": "https://example.com/images/product-photo.webp",

    "name": "Product Name",

    "description": "Descriptive alt text for this image",

    "width": 800,

    "height": 600

    }

    ```

    For recipe sites: include images in Recipe schema. For product pages: include images in Product schema. For articles: include images in Article schema. Google uses these schemas to populate Image Search and Shopping surfaces.

    5. Image sitemaps

    If images are hosted on a CDN or dynamically loaded (JavaScript-rendered), Googlebot may not discover them through normal crawling. An image sitemap ensures they're indexed.

    Add images to your XML sitemap using the image extension:

    ```xml

    <url>

    <loc>https://example.com/blog/post-title/</loc>

    <image:image>

    <image:loc>https://cdn.example.com/images/post-hero.webp</image:loc>

    <image:title>Descriptive image title</image:title>

    <image:caption>Optional image caption</image:caption>

    </image:image>

    </url>

    ```

    For most sites using Next.js, Gatsby, or WordPress with a sitemap plugin, images embedded in standard <img> tags on crawlable pages will be discovered automatically. Sitemaps become critical when images are loaded dynamically or hosted on external domains.

    6. Open Graph and Twitter Card images

    Your social sharing images (og:image, twitter:image) aren't directly SEO signals for Google search — but they affect click-through rates on social platforms, which drives traffic. More traffic to your pages can indirectly improve rankings through engagement signals.

    For blog posts and articles, each post should have a unique OG image. A 1200×630px image with the article title is the standard.

    ```html

    <meta property="og:image" content="https://example.com/blog/post-og.jpg">

    <meta property="og:image:width" content="1200">

    <meta property="og:image:height" content="630">

    <meta property="og:image:alt" content="Article title or description">

    ```

    7. The image SEO checklist

    Before publishing any page with images, check:

  • [ ] Every image has a descriptive, hyphenated, lowercase filename
  • [ ] Every informative image has unique, descriptive alt text (max 125 chars)
  • [ ] Images are in WebP format (or have WebP alternatives)
  • [ ] Images are compressed (quality 80 for photos)
  • [ ] Images are sized to display dimensions (not oversized)
  • [ ] Hero/above-fold images have `fetchpriority="high"` (not lazy)
  • [ ] Below-fold images have `loading="lazy"`
  • [ ] All images have explicit width and height attributes
  • [ ] EXIF metadata is stripped (especially GPS data)
  • [ ] Images appear in sitemap (or are crawlable via standard img tags)
  • [ ] Structured data is implemented where relevant (Product, Recipe, Article)
  • Common image SEO mistakes

    Using generic filenames from cameras. DSC_0042.jpg, IMG_20240315_143022.jpg — these tell Google nothing.

    Missing or empty alt text. Roughly 40% of web images have missing or placeholder alt text. This is a significant missed opportunity.

    Serving oversized images. A 4000×3000 hero image that displays at 1200×800 wastes 10x the bandwidth. Resize before uploading.

    No WebP. Sites still serving JPEG-only images are losing 25–35% file size savings and the corresponding Core Web Vitals improvements.

    Lazy-loading hero images. The LCP element should load immediately. Adding loading="lazy" to your hero image directly hurts your LCP score and rankings.

    No width/height on images. Without these, the browser can't reserve space before the image loads, causing layout shift (CLS).


    FAQ

    How long does it take for image SEO changes to impact rankings?

    Google recrawls most pages within a few days to a few weeks of a change. After recrawling, ranking changes for Image Search can take another few weeks to manifest. For page-level SEO impacts (Core Web Vitals improvements from compression), changes tend to propagate faster — often within a few weeks after Google's next crawl of affected pages.

    Does Google index all images on the web?

    No — Google indexes images it can discover and parse. Images must be in formats Google supports (JPEG, PNG, GIF, WebP, SVG, BMP), accessible to Googlebot (no robots.txt blocks), and in a format Google can render (not purely CSS backgrounds, not hidden images). Images loaded by JavaScript are indexed but may take longer.

    Is there an ideal image file size for SEO?

    There's no specific size target — Google cares about load speed (LCP) rather than file size per se. As a practical guideline: hero images under 200KB, article images under 100KB, thumbnails under 30KB — these targets correlate with good LCP scores on most connection speeds.

    Share this article

    Try SammaPix free

    Compress, convert to WebP, and AI-rename your images — no signup needed for compression. 100% client-side, images never leave your browser.

    Start optimizing