Technology guides
How to Optimise Images for Your Website: Size, Format and Speed
Large images are the main cause of slow websites. Learn which formats, sizes and compression settings to use so your pages load fast and still look sharp.
Published

Images usually make up most of a web page's weight. A single unoptimised photo straight from a phone can be 4 to 8 MB, enough to make a page slow on mobile. Optimising images is one of the quickest ways to improve website speed and search rankings.
1. Resize to the size you actually display
If an image is shown 800 pixels wide, uploading a 4,000-pixel original wastes bandwidth. As a guide:
- Full-width hero images: 1,600 to 2,000 px wide.
- Blog and content images: 1,200 px wide.
- Thumbnails and cards: 400 to 800 px wide.
Provide several sizes and let the browser choose the right one for each screen (the HTML srcset attribute does this). Many modern website platforms do this automatically.
2. Use modern formats
- WebP: supported by all modern browsers and usually 25 to 35% smaller than JPEG at similar quality.
- AVIF: even smaller in many cases, with growing support.
- JPEG: a safe fallback for photographs.
- PNG: for graphics needing sharp edges or transparency.
- SVG: for logos and icons. It is sharp at any size and tiny.
3. Compress sensibly
A quality setting of around 75 to 85 for WebP or JPEG is usually indistinguishable from the original. Aim for most content images to be under 150 KB, and hero images under about 250 KB. Always check the result on a high-resolution screen.
4. Help the page load smoothly
- Set width and height on images so the page does not jump as they load. This improves Cumulative Layout Shift (CLS).
- Lazy-load images further down the page so they load only when needed.
- Do not lazy-load the main image at the top of the page. It affects Largest Contentful Paint (LCP).
5. Write good alt text and file names
- Alt text describes the image for screen reader users and search engines. Keep it short and specific, for example "Bootable USB drive in retail packaging".
- File names should be descriptive and hyphenated, such as "bootable-usb-drive.webp", not "IMG_4821.jpg".
6. Use images you have the rights to
Only use photos you took, licensed or have permission to use. Avoid other companies' logos and trade marks in your marketing images.
Frequently asked questions
Will compressing images reduce quality?
Slightly, but at sensible settings the difference is not visible on screen. Keep your originals in case you need them later.
Need a faster website?
Read our guide to [Core Web Vitals](https://htreasure.com/blog/core-web-vitals-website-speed-guide), or talk to our [website development](https://htreasure.com/services/website-development) team.