Image optimization makes pictures fast to load and easy to understand for search engines and AI. Learn formats, compression, alt text and lazy loading.

On this page
Summary
Image optimization is the practice of compressing, naming, sizing, and structuring images so they load quickly and so search engines and AI systems can understand them. It covers the file format, compression, alt text, file names, dimensions, lazy loading, responsive delivery, and sitemap or structured data signals.
Want to go further? Ask
Image optimization means making every picture on a page light enough to load fast and clear enough for machines to read. A fast image helps the page itself, because images are often the heaviest part of a page. A well described image helps the page get found, because crawlers depend on the markup around a picture rather than seeing it the way people do. The work sits between performance and image search optimization, and it matters more as visual search and AI answers pull pictures into results.
Image optimization is the set of choices that make an image useful to both people and machines. The people side covers speed and sharpness: the file should load quickly and look right on phones and laptops. The machine side covers meaning: the file name, the alt text, the surrounding text, and any structured data tell a crawler what the picture shows and why it sits on the page. Google's image SEO guidance treats both halves as part of getting images found, and it stresses standard HTML image elements so crawlers can find and process each picture.
Use WebP or AVIF for most photographs, JPEG as a fallback, PNG when you need transparency, and SVG for logos and icons. Google Search Central lists BMP, GIF, JPEG, PNG, WebP, SVG, and AVIF as supported formats for search. The web.dev LCP guide names AVIF and WebP as more optimal formats for large images, which is why they are the usual first choice when page weight matters.

| Format | Best use | Watch out for |
|---|---|---|
| WebP | Photographs and most raster graphics | A strong default for most sites |
| AVIF | Photographs where the smallest file matters most | Keep a fallback in place for older browsers |
| JPEG | Photographs when a fallback is needed | Large files at high quality |
| PNG | Images that need transparency | Heavy for photographs |
| SVG | Logos and simple icons | Only for vector artwork |
Compress each image to the smallest file that still looks right at the size it is displayed. Lossy compression discards some image data and suits photographs, where the eye rarely notices the loss at a sensible quality setting. Lossless compression keeps every pixel and suits diagrams, screenshots, and illustrations, where small artifacts show around sharp edges and text. Resize the image to its display size before compressing, because a file that is far larger than its slot wastes bandwidth no matter how well it is compressed.
Sorank's free image compressor handles JPEG, PNG, and WebP files, which makes it a quick check on a single picture before you publish it. For a whole library, build compression into your upload process so new files never arrive oversized.
Write alt text as a factual description of the image in its context, and use an empty alt attribute for decorative images. Screen readers read the alt text aloud, browsers show it when an image fails to load, and search engines use it to understand the picture. Treat alt text as a description, not as a place to stuff keywords. The W3C's alt decision tree makes the split clear: an informative image gets a description, while a decorative image gets an empty alt attribute so assistive technology skips it.
File names are an early clue that a crawler reads before the image renders. Google advises filenames that are short but descriptive, and it suggests the file extension match the real file type. A name such as image-optimization-checklist.webp tells a crawler more than IMG_4021.jpg. Use lowercase words separated by hyphens, and keep the name consistent with the topic of the page.
Set width and height on every image, and add loading="lazy" to images that sit below the fold. Width and height tell the browser how much space an image needs before the file arrives, so the text around it does not jump. The lazy attribute defers images further down the page until the reader scrolls near them, which frees bandwidth for the content that appears first. web.dev's guide to browser-level lazy loading recommends it for most images and needs no extra script.
<img src="/images/team-review.webp" alt="Two marketers reviewing a crawl report on a laptop" width="1200" height="800" loading="lazy">
Do not lazy-load the main image at the top of the page. web.dev's advice on the LCP image is clear: never lazy-load it, because that delays the image that usually sets the Largest Contentful Paint. For that image, use a high fetch priority instead. Our LCP definition explains how the metric is measured.
Use an image sitemap on large or script-heavy sites, and add ImageObject markup where an image is a meaningful part of the content. Google's image sitemap documentation explains that these files inform Google about images on a site, including images found through JavaScript, so it can discover pictures that a crawler might miss in the page markup. You can add image entries to an existing sitemap or create a separate one. Many content management systems generate these entries automatically.
Structured data adds explicit meaning. The schema.org ImageObject type describes an image file with properties such as its content URL, creator, and license. Keep those values identical to what the page shows, and reserve the markup for images that carry real meaning, such as a product photo or a step in a how-to guide. For the wider picture, read our image SEO guide.
Each mistake either slows the page or hides meaning from machines. Fix them in a set order: resize to the display size, choose the format, compress, write factual alt text, name files descriptively, then set dimensions and lazy loading on every image except the main one.
For SEO, images touch the experience signals that Google measures. Heavy files slow the render, and missing dimensions make the layout jump, and both weaken the experience that Core Web Vitals track. Google's guidance also stresses that standard HTML image elements help crawlers find and process images, and that it does not index images that exist only as CSS backgrounds, so pictures placed with standard markup are the ones that can surface.
For GEO, the picture reaches AI systems through the same signals. Some AI systems read an image alongside the text around it, so a clear file name, a factual alt text, and a caption that names the subject give them a consistent description. Optimized visuals also earn their place in image results when people search visually, which is the practical side of making images findable for both search and AI answers.
Image optimization makes visuals fast for readers and legible for machines. Choose a suitable format, compress to the display size, write factual alt text, name files descriptively, set dimensions, lazy-load everything except the main image, and publish an image sitemap on large sites. These steps support page speed and the experience signals behind rankings, and they give AI systems a clear description of each visual.
Sources
For most photographs, WebP or AVIF is the best choice because both produce smaller files than older formats. Keep JPEG as a fallback, use PNG for transparency, and SVG for logos and icons. Google Search Central lists BMP, GIF, JPEG, PNG, WebP, SVG, and AVIF as supported formats.
Alt text helps search engines understand what an image shows, and screen readers read it aloud. Describe the image factually in its context, and leave the alt attribute empty for decorative images so assistive technology skips them.
Browser-level lazy loading is recommended for most images. Do not apply it to the main image at the top of the page, because that delays the Largest Contentful Paint.
