OXO Yazılım
All Posts

Image Optimization for Page Speed: WebP and Lazy Loading

November 12, 20263 min read

Images are often the biggest reason a site loads slowly. We explain how WebP, correct sizing and lazy loading can make your pages noticeably lighter and faster.

Most of the total download size of a web page usually comes from images. A few photos taken with a phone and uploaded directly are enough to weigh a page down on a mobile connection. Image optimization means reducing file size without visibly harming quality, and it is one of the easiest and most effective jobs for page speed.

Choose the right size first

Uploading a 4000-pixel original for an image shown at 800 pixels wide is wasteful. Resize the image to the largest width it will be used at. For retina screens, twice that width is usually enough. Resizing alone can cut file size several times over.

The right format: WebP

WebP is a format supported by modern browsers that often produces smaller files than JPEG and PNG. It supports transparency as well. It can be used instead of JPEG for photos and instead of PNG for transparent logos. Newer formats exist, but WebP is a safe start thanks to its wide compatibility. What matters is that a fallback version can be served where browser support is limited.

  • Photos: WebP or quality-tuned JPEG
  • Logos and icons: SVG where possible
  • Simple illustrations: SVG or WebP

Compression and quality setting

Keeping the quality value very high is unnecessary. For most photos a medium-high setting gives a much smaller file with a difference the eye cannot notice. Try several settings side by side and pick the one that looks good enough. For bulk work, command line tools or image processing scripts can be used.

Lazy loading

Loading images that are not visible on the first screen immediately is wasteful. With native lazy loading supported by browsers, images load as the user scrolls. However, the main image at the very top should not be loaded lazily; on the contrary it should be prioritized, because it determines the perceived speed of the page.

Responsive images and layout shift

It is possible to serve files of different sizes for different screen widths, so a phone does not download the large file prepared for desktop. Adding width and height information to images also prevents the page from jumping while the image loads, which matters for both user experience and measured page experience.

Alt text and file names

Writing meaningful alt text for an image helps accessibility and search engines. Keeping file names meaningful, short and lowercase also brings order.

A quick routine

When you add a new image, follow the same three steps: resize it to the width you need, export it as WebP with a sensible quality, and check that it has alt text and fixed dimensions. A short routine like this keeps pages light without constant audits, and makes it easy for anyone on your team to publish content without slowing the site.

Conclusion

Image optimization is not done once and forgotten; it should become a habit as new content is added. Resize, use WebP, load on scroll and monitor the result with page speed tools. To improve your site speed together, see our web design service or contact us.