Home/Blog/How to Optimize Images for Your Website: A Complete Guide
GuidesBy Bryan BuenoยทApril 28, 2026ยท8 min read

How to Optimize Images for Your Website: A Complete Guide

Poorly optimized images are the single most common cause of slow-loading websites. This guide covers everything you need to know to fix it.

Images typically account for 60โ€“70% of a webpage's total size. If your website loads slowly, unoptimized images are almost certainly the reason. This guide explains how to optimize images correctly โ€” improving load speed, SEO rankings, and user experience at the same time.

Why image optimization matters

Page load speed directly affects whether visitors stay on your site or leave. Google's research found that as page load time increases from 1 second to 3 seconds, the probability of a visitor leaving immediately (bounce rate) increases by 32%. At 5 seconds, that jumps to 90%.

Core Web Vitals โ€” Google's set of user experience metrics used directly in search ranking โ€” include metrics like Largest Contentful Paint (LCP), which measures how long the largest image or text block takes to render. Unoptimized images cause poor LCP scores, which hurt search rankings.

Bandwidth and hosting costs scale with data transfer. Serving unnecessarily large images costs more and causes slow loading on mobile connections and in regions with limited internet infrastructure.

The five principles of image optimization

1. Use the right dimensions

Never serve an image larger than the dimensions it will be displayed at. If a blog post shows article thumbnails at 400ร—250 pixels, there is no reason to serve a 4000ร—2500 pixel image and let the browser shrink it. The browser still downloads every pixel of the full-size file before scaling it down for display.

Correct approach: Resize images to match their display dimensions before uploading. If you need the same image at multiple sizes (thumbnail, medium, full-width), create separate files for each size.

A practical workflow: open the original high-resolution image in BG Bueno's Image Resizer, enter the maximum display width your layout uses for that image, and download the correctly sized file.

2. Choose the right format

Match the format to the content type:

  • โ€ขPhotographs โ†’ WEBP (first choice) or JPG
  • โ€ขLogos and icons โ†’ SVG (for vector graphics) or PNG (for complex graphics with transparency)
  • โ€ขScreenshots โ†’ PNG or WEBP
  • โ€ขGraphics with flat colors โ†’ WEBP or PNG

WEBP is the best general-purpose format for web images. It produces files 25โ€“35% smaller than equivalent-quality JPG or PNG files and is now supported by all modern browsers. Use it by default unless you have a specific reason not to.

3. Compress without visible quality loss

For JPG and WEBP, quality settings between 75 and 85 produce files that are 60โ€“75% smaller than uncompressed originals with essentially no visible quality difference when viewed at normal screen sizes.

The right quality level depends on the image content:

  • โ€ขHigh-detail photographs with rich texture: 80โ€“85
  • โ€ขStandard product photos: 78โ€“82
  • โ€ขThumbnails and preview images: 70โ€“78
  • โ€ขFull-width hero images: 82โ€“88 (larger display size makes artifacts more visible)

Always check the compressed result by viewing it at 100% zoom on a high-quality monitor. If you can't see compression artifacts, the quality is acceptable.

4. Add descriptive alt text

Alt text is the HTML attribute on img tags that describes the image for:

  • โ€ขScreen readers used by visually impaired visitors
  • โ€ขSearch engines that can't see images but can read text
  • โ€ขBrowsers when images fail to load

Poor alt text: alt="image1.jpg" or alt="photo"

Good alt text: alt="Red leather wallet open to show card slots and cash pocket" or alt="Screenshot of the BG Bueno background remover showing a before and after comparison"

Write alt text as a concise, accurate description of what's in the image and why it's there. Include relevant keywords naturally โ€” don't keyword-stuff.

5. Use lazy loading

Lazy loading delays loading images that are below the fold (not visible when the page first loads) until the user scrolls toward them. This dramatically reduces initial page load time because the browser only needs to load the images visible in the viewport.

In modern HTML, enabling lazy loading requires adding a single attribute to your img tag: loading="lazy"

Always specify width and height attributes alongside lazy loading. Without them, the browser doesn't know how much space to reserve for the image, causing layout shifts as images load โ€” which harms your Cumulative Layout Shift (CLS) Core Web Vitals score.

Image SEO: getting your images to appear in Google Images

Images that appear in Google Images are a legitimate source of organic traffic. To optimize for image search:

Use descriptive filenames. Before uploading, rename files to describe the content: red-leather-wallet.webp is better than IMG_4892.jpg. Google can read filenames and uses them as a relevance signal.

Write good alt text (covered above). This is the most important factor for image SEO.

Use structured data for product images. If you're running an e-commerce site, implement Product schema markup that references your product images. This can result in rich results in Google Search including image thumbnails.

Create an image sitemap. Include image URLs in your XML sitemap. This helps Google discover images, particularly on JavaScript-rendered pages.

Use descriptive captions. Text surrounding an image on the page provides context that improves Google's understanding of what the image shows.

A practical optimization workflow

For each image you want to add to your website:

  1. 1Start with the original high-resolution file. Never start from an already-compressed version.
  2. 2Determine the maximum display width this image will ever be shown at on your site. Check your CSS or use browser dev tools to inspect the rendered image size.
  3. 3Resize to that width using BG Bueno's Image Resizer. If your site is responsive, consider creating two or three sizes for different breakpoints.
  4. 4Convert to WEBP if the image is a photograph or complex graphic. If it's a logo with transparency, use PNG.
  5. 5Compress using BG Bueno's Image Compressor. Start at quality 82 for photographs. Check the result, then reduce further if needed.
  6. 6Name the file descriptively using keywords separated by hyphens.
  7. 7Upload and write good alt text in your CMS.

Common mistakes to avoid

Scaling up small images. Enlarging a low-resolution image doesn't add quality โ€” it just makes a blurry image larger. Always start with a high-resolution original.

Forgetting mobile users. Many visitors are on mobile connections. An image that loads acceptably fast on WiFi may take 10 seconds on a 4G connection. Check your compressed file sizes and aim for under 100 KB for standard content images, under 200 KB for hero images.

Using PNG for photographs. PNG is excellent for graphics but a poor choice for photographs โ€” the files are 5โ€“15ร— larger than equivalent-quality JPG or WEBP with no visible quality benefit.

Not testing actual performance. Run your pages through Google PageSpeed Insights or WebPageTest after optimization. The numbers tell you whether your optimizations actually worked.

BG Bueno tools

BG Bueno's own image tools are free to use, with no account required, and your files stay in your browser.

Open BG Bueno โ†’

Keep reading

More articles