Brand, websites, SEO & GEO and automations for small businesses.

WhatsApp
Guides

Image SEO: file names, alt text, formats and file weight

Image SEO: how to name your files, write helpful alt text, and compress images for Google, AI search assistants, and your visitors.

Small empty white photo frame on a pale shelf with a lens cap and a blue bookmark

A well-chosen photograph sells a signature dish, a new haircut, or bespoke kitchen cabinetry. For Google and generative AI assistants, however, an image remains an opaque data file unless surrounding signals explain what it depicts. Successful image SEO relies on four technical fundamentals: descriptive file naming, useful alternative text, contemporary image formats, and sensible file compression. Here are the four steps, guided by official Google and web.dev specifications, alongside our agency perspective.

Why image search engine optimisation matters

Images influence performance in two distinct ways: they attract qualified search visitors through Google Images, and they constitute the heaviest payload on a page, directly affecting page speed and organic rankings. Configured correctly, they support both goals simultaneously.

Google documentation explains that it extracts image subject matter "from the content of the page, including captions and image titles", advising site owners to place images "near relevant text". A photograph of your dining room situated beneath the heading "Our dining room", accompanied by a brief descriptive caption, creates a powerful semantic signal.

One critical limitation to note: Google "does not index CSS images". A background photo loaded via a CSS rule does not exist for Google Images; search engines only index standard HTML <img> elements. Many off-the-shelf WordPress themes place hero images as CSS backgrounds. AI assistants such as ChatGPT and Perplexity also rely on HTML text elements rather than rendering background styles.

File naming: descriptive, lowercase, separated by hyphens

A strong file name describes what the image shows in three to six words, separated by hyphens, using lowercase characters without punctuation. Google itself illustrates this: "my-new-black-kitten.jpg is a lot more informative than IMG00023.JPG", and advises against generic names such as "image1.jpg" or "pic.gif".

The most common mistake is uploading smartphone camera filenames like "IMG_4821.HEIC" directly to the media library, often hundreds of times. Three clear rules prevent this:

  • Use a name that describes the picture rather than the page template: restaurant-outdoor-terrace-bristol.jpg rather than homepage-banner-1.jpg.
  • No spaces, accented letters, or capital letters. Spaces become messy %20 codes in URL strings.
  • Multilingual websites: Google recommends translating image file names across localized versions.

Our recommendation: rename image files locally before uploading them to your CMS. Renaming an image after publication alters its URL path, whereas Google suggests serving images "with the same URL over time" to maximize caching efficiency.

Alternative text: descriptive sentences over keyword lists

The alt attribute describes the image for anyone who cannot see it: screen readers, browsers where images failed to load, and search engine crawlers. It summarizes the image in a single concise sentence. Google documentation outlines a clear progression:

  • Bad: <img src="puppy.jpg"/>, omitting the alt attribute altogether.
  • Equally bad: an alt value such as "puppy dog baby pup puppies...". Google terms this keyword stuffing and warns that it "can cause your site to be seen as spam".
  • Better: alt="puppy".
  • Best practice: alt="Dalmatian puppy playing fetch with a yellow tennis ball".

For a craftsman, use alt="Bespoke solid oak kitchen with central island installed in Bristol" rather than alt="cabinet maker bristol cheap oak kitchen carpentry".

Alternative text is an accessibility mandate

Alternative text forms the very first checkpoint in web accessibility standards. WCAG 2.2 Success Criterion 1.1.1 requires that all non-text content presented to users has a text alternative serving an equivalent purpose. In France and across the EU, public bodies and large enterprises must comply under national accessibility rules (RGAA). Two specific scenarios require attention:

  • Purely decorative visuals (background patterns, divider borders, decorative icons that duplicate neighbouring text) must be hidden from assistive tools. In practice, supply an empty alt="", never omit the attribute entirely.
  • Embedded text within pictures (promotional flyers, Canva graphics) should be replaced with styled live HTML text wherever feasible. Search engines cannot reliably read pricing printed across graphic pixels.

We explain these legal obligations in our guide to website accessibility requirements. For imagery, accessibility and search engine optimisation are identical disciplines.

Compression: modern formats, correct sizing, and lazy loading

Images must be served at the precise dimensions at which they display, saved in modern lightweight formats, and deferred until they approach the active viewport. The 2024 HTTP Archive Web Almanac demonstrates the scale: in late 2024, the median mobile page weighed 2,311 KB, with 900 KB of images. A single raw smartphone photo routinely exceeds that entire threshold.

Selecting the right format

According to web.dev, "WebP and AVIF provide generally better compression than older formats and should be used where possible", and modern web browsers support them natively. Google indexes image elements containing BMP, GIF, JPEG, PNG, WebP, SVG, and AVIF files.

Image categoryRecommended formatRationale
Photographs (food, premises, portraits)AVIF or WebP, JPEG fallbackMaximum compression ratio at near-identical visual fidelity
Brand logos, icons, vector pictogramsSVGCrisp at every screen resolution with minuscule file weight
Detailed screenshots with fine typographyPNG or lossless WebPPreserves razor-sharp text outlines without compression artifacts
Short loop animationsMuted looping <video>web.dev: GIF is restricted to 256 colours and weighs considerably more

Serving appropriate image dimensions

A 4,000-pixel photograph rendered inside a 600-pixel content column forces mobile devices to download six times more data than needed. Google recommends employing srcset and sizes attributes, providing multiple resolution variants alongside a standard fallback src URL for legacy crawlers. Modern platforms such as WordPress, Webflow, and Shopify implement responsive image sets automatically.

Reserving space: width and height attributes

Every image element must include intrinsic width and height attributes. Guidance from web.dev is explicit: "Always include width and height size attributes on your images and video elements", or set equivalent layout dimensions with the CSS aspect-ratio property. Without these values, browsers allocate zero vertical space initially, abruptly shoving content down once the file arrives. This shift is captured by Cumulative Layout Shift (CLS), one of the three core Core Web Vitals metrics, where good scores must remain at or below 0.1.

Deferring offscreen media

The loading="lazy" attribute directs browsers to postpone loading an image until it nears the user viewport. Google confirms full support for native lazy loading because it functions without requiring manual user interaction or scrolling, which search crawlers do not execute.

Two essential caveats from web.dev and Google: never lazy-load images positioned in the initial viewport, especially your primary hero image (the Largest Contentful Paint candidate), as this directly harms loading performance. Furthermore, if your theme relies on custom JavaScript lazy-loading scripts, verify via Google Search Console URL Inspection that image sources appear within rendered HTML src attributes. Otherwise Google cannot discover your images. Our guide on how to test and fix website speed explains how to verify this.

Do you need an image sitemap?

Rarely for a standard business website: contextual body text and proper alt tags are generally sufficient. An image sitemap is intended for image-heavy portfolios or sites displaying media via client-side JavaScript. It lists up to 1,000 images per page that crawlers might otherwise overlook. The fundamentals are outlined in our guide on what XML sitemaps are and how to build them.

How Resolve agency handles images

At Resolve agency (Re:solve), image assets pass through an automated optimization pipeline on every build: renamed and resized before upload, generated in AVIF and WebP with legacy JPEG fallbacks, embedded as semantic <img> tags with explicit dimensions and responsive srcset profiles, and lazily loaded below the fold. Alt tags are authored by hand: automated tools invariably produce empty, generic phrases.

Consider a common scenario: a private clinic site carrying thirty uncompressed 4 MB photos, titled with raw camera codes, loaded as CSS background covers. Following technical remediation, they weigh tens of kilobytes, feature descriptive titles, and appear in Google Images. We make no ranking guarantees: we simply remove the technical obstacles preventing search engines from understanding your work.

To review your existing media assets, our free website audit flags missing alt descriptions, obsolete image formats, and excessive page weight.

Frequently asked questions

Should I include the primary page keyword in every alt tag?

No. Alternative text describes the specific image, not the entire page. If your focus phrase genuinely describes what is in the photograph, include it naturally. Repeating the exact same phrase across twenty images constitutes keyword stuffing, which Google explicitly advises against.

Does the image title attribute help search rankings?

Google notes that it processes titles and captions alongside page text, but the title attribute only appears on desktop mouse hover and is ignored on mobile touchscreens. Direct your effort into the alt attribute and a visible caption beneath the picture.

Must I convert all historic images into WebP or AVIF?

Prioritise high-traffic pages first: your homepage, main service pages, and key conversion assets. Converting legacy archives is helpful over time, but the marginal return is lower, so you can update older media gradually during routine maintenance.

Further reading

Start today.

We review your brand, website and online visibility, then set out your priorities.

Chat on WhatsApp