How to Resize and Compress Images for a Faster Website
By AllToolz4U Team · · Updated · 5 min read

If your website feels slow, look at the images before anything else. A single phone photo straight from the camera can be 4 to 6 MB. Put five of them on one page and visitors on a mobile connection are waiting for tens of megabytes before the page feels finished.
Fixing this does not need special skills. It needs a short routine: resize, then compress, then pick the right format, then load smartly. The order matters, so let us go through it.
Why images matter for speed and search
Google measures real-world page experience with Core Web Vitals. One of them, Largest Contentful Paint (LCP), is the time until the biggest visible element on the screen has loaded. That element is very often an image, such as a banner or the main photo of an article. Google considers an LCP of 2.5 seconds or less as good. A heavy hero image can push you past that on its own.
Speed also affects people directly. Visitors on slow connections leave pages that take too long, and that hurts everything you want from the page, whether that is reading, signing up or clicking an ad.
Step 1: Resize to the size it is shown at
Resizing means changing the pixel dimensions, for example from 4000 x 3000 to 1200 x 800. This is the biggest saving, because file size grows with the number of pixels. Serving a 4000-pixel-wide photo into a space that is 800 pixels wide makes the browser download pixels it will throw away.
| Where the image appears | Suggested width in pixels |
|---|---|
| Full-width banner or hero image | 1600 to 2000 |
| Image inside an article column | 800 to 1200 |
| Product or card thumbnail | 400 to 600 |
| Logo or icon | As small as it is shown (often under 400) |
A useful rule: look at how wide the image is displayed on a desktop screen and make the file up to twice that width. The extra pixels keep it sharp on high-density (retina) screens without going overboard.
Step 2: Compress
After resizing, compression reduces the file further.
- Photos (JPEG or WebP): quality around 75 to 85 is the usual sweet spot. Most people cannot tell the difference from 100, and the file is a fraction of the size.
- Logos, icons and screenshots (PNG): PNG is lossless, so you save space by reducing the number of colours or using a tool that optimises PNG files. For simple flat graphics, SVG is often the smallest option of all.
Always compare the result with the original at normal viewing size. If faces look waxy or skies show visible bands, raise the quality a notch.
Step 3: Choose a modern format
WebP produces smaller files than JPEG or PNG at similar visual quality and is supported by all current major browsers. For photos, exporting as WebP (or JPEG where WebP is not an option) is a good default. We compare the formats in detail in our guide JPG vs PNG vs WebP.
Step 4: Load images smartly
- Lazy-load images below the fold. Adding
loading="lazy"to an image tells the browser to wait until the visitor scrolls near it. - Do not lazy-load the main image at the top. The hero or first large image should load immediately. Delaying it makes LCP worse.
- Use responsive images. The
srcsetattribute lets you offer several sizes so a phone downloads the 600-pixel version while a laptop gets the 1200-pixel one. - Set width and height. Declaring the dimensions reserves space so the page does not jump while images load.
Step 5: The small details that help
- Descriptive file names. red-running-shoes.webp is better than IMG_4832.jpg.
- Alt text. A short description helps screen reader users and gives search engines context. Describe what the image shows; do not stuff keywords.
- Only use images that add something. A decorative stock photo that says nothing costs load time and gives visitors no value.
Mistakes that quietly slow a site down
- Uploading the original and letting the page shrink it. CSS can display a 4000-pixel image at 400 pixels wide, but the browser still downloads the full file. Resize the file itself.
- Using PNG for photographs. PNG is lossless, so photos become several times larger than the same photo as JPEG or WebP.
- Animated GIFs. A short GIF can be many megabytes. A short video or an animated WebP is usually a fraction of the size.
- Forgetting dimensions. Without width and height the page layout jumps as images arrive, which hurts the visual stability score in Core Web Vitals.
- Loading everything at once. Long pages with dozens of images should lazy-load those below the first screen.
How to test your result
Run the page through Google PageSpeed Insights (it is free). The report points out oversized images, images that could use a newer format, and the element that counts as your Largest Contentful Paint. Fix what it flags, test again, and compare the numbers on mobile, since that is where heavy images hurt most.
A routine you can repeat
- Decide the display width for the image.
- Resize the original to that width (or up to double).
- Export as WebP or JPEG at about 80% quality; PNG or SVG for flat graphics.
- Check the result, name the file clearly, add alt text.
- Upload, mark below-the-fold images as lazy, leave the top image alone.
- Test the page with a speed testing tool such as Google PageSpeed Insights and fix the images it flags.
Do this consistently and images stop being the reason your pages are slow. A page with well prepared images is usually only a few hundred kilobytes of picture data instead of several megabytes, and visitors notice the difference immediately.
Frequently Asked Questions
Should I resize or compress an image first?
Resize first. Reducing the pixel dimensions gives the largest saving, and compressing a smaller image afterwards is faster and keeps more detail than compressing a huge one.
What image quality setting is best for the web?
For JPEG and WebP photos, around 75 to 85 percent works well. Test on your own images, since detailed photos can need a slightly higher setting.
What size should my website images be?
Match the width they are displayed at, and allow up to twice that for sharp display on high-density screens. A full-width banner is typically 1600 to 2000 pixels wide, an article image 800 to 1200.
Does image size affect SEO?
Indirectly, yes. Images that make pages slow can hurt Core Web Vitals such as LCP, and good file names and alt text help search engines understand the image.


