Image compression is one of the simplest ways to speed up your website. On most sites, images are the heaviest part of the page, and a single photo uploaded directly from a camera can weigh more than the rest of the page combined. This guide explains the differences between compression types, which formats to choose, what dimensions to use, and which tools deliver results. This topic is central to improving website speed and general SEO optimization.

- Using lossy compression at a reasonable quality level significantly reduces file size with almost no visible difference.
- Modern formats like WebP and AVIF usually result in smaller files than JPEG at the same quality level.
- Upload images at the width they are displayed, not their original camera resolution.
- Lazy loading is perfect for images below the fold, but it should not be applied to the main hero image.
- WordPress creates multiple sizes for every image and serves the most appropriate one for each screen.
Table of contents
How does image compression affect website speed?
Every image on a page must be downloaded from the server to the visitor's device. Larger files take longer to load, especially on mobile networks. Google measures loading speed using several metrics, the most relevant being LCP (Largest Contentful Paint), which tracks how long it takes for the largest element in the viewport to appear. On most pages, this element is an image.
According to web.dev on LCP, a good score is 2.5 seconds or less. A heavy hero image is a common reason for exceeding this limit. Proper compression reduces file size and the time it takes for the image to appear.
Lossy vs. lossless compression: What is the difference?
There are two compression methods. In lossless compression, the file size is reduced while keeping every pixel identical. In lossy compression, some data is removed, mostly details invisible to the human eye, resulting in a much smaller file. For website images, lossy compression at a reasonable quality level is usually the best choice.
| Type | What happens to the file | Best use case |
|---|---|---|
| Lossy | Significantly smaller, some details are removed | Photos, background images, blog post images |
| Lossless | Slightly smaller, all details preserved | Logos, screenshots, graphics with text |
| Vector (SVG) | A code-based file, sharp at any size | Logos and simple icons |
Which quality level should you choose?
There is no single quality setting that fits every image; the best way is to compare. Upload an image to a tool like Squoosh, gradually lower the quality, and stop when you notice a visual difference. For standard photos, a medium-to-high setting usually saves significant weight without any noticeable loss in quality.
Which image format should you choose for your website?
JPEG is the legacy format for photos, while PNG is best for graphics with transparency. Modern formats like WebP and AVIF offer superior compression. According to web.dev's guide to WebP, WebP files are typically 25% to 35% smaller than JPEG and PNG equivalents. All major browsers now support WebP.
- WebP: A safe choice for most website images, with broad support.
- AVIF: Offers even higher compression, but creation is slower and visual quality should be checked.
- JPEG: Still works everywhere and is great as a fallback.
- PNG: Only when transparency or crisp graphics are needed; avoid for photos.
- SVG: For logos and icons, provided the file is clean of unnecessary code.
WordPress has supported WebP files since version 5.8 and AVIF since version 6.5, provided your server supports them.
What size should I upload images to my website?
The most common mistake is uploading a 4,000-pixel wide image when it is only displayed at 800 pixels. The browser downloads the entire file and then scales it down, forcing the visitor to wait. The rule is to upload images at the maximum width they will actually be displayed, or up to 2x for high-resolution screens.
WordPress automatically generates several sizes for every uploaded image and adds the srcset attribute to the code. This allows the browser to choose the best size for the screen: a phone gets a small file, and a wide desktop screen gets a larger one. This only works effectively if the original image isn't excessively large to begin with.
Remember that most visitors to Israeli business websites are on mobile devices. Phone screens are much narrower than computers, so there is no reason to download a file meant for a wide monitor. When testing your site, check it on a mobile network, not just your high-speed office connection; that is where the impact of heavy images is felt most. Learn more about mobile impact on rankings in our article on mobile friendliness.
What is image lazy loading?
Lazy loading tells the browser not to download an image until the visitor scrolls near it. WordPress has added this automatically since version 5.5. This makes long pages with many images load faster because only the images currently on screen are downloaded initially.
There is one important exception: you must never lazy load the hero image at the top of the page. According to web.dev guidelines on lazy loading, lazy loading an image that is visible as soon as the page opens delays its appearance and hurts LCP. This image should load immediately.
Building a routine for image compression
A one-time compression of all website images helps, but the problem returns as new images are uploaded. Establish a simple workflow for anyone adding content to the site.
- Resize before uploading: Save images at the width they will actually be displayed, such as 1,600 pixels for a blog post cover image.
- Clear filenames: Use descriptive English or Hebrew names instead of generic camera filenames.
- Upload via a compression plugin: The plugin compresses and converts images to WebP the moment they are uploaded.
- Write alt text: Use a short descriptive sentence for accessibility and SEO.
- Quarterly audits: Run speed tests on key pages to catch heavy files that were added over time.
Common image compression mistakes
- Double compression: Resaving an already compressed JPEG reduces quality every time. Always work from the original file.
- Photos in PNG format: A standard photo saved as a PNG can be several times larger than the same photo in JPEG or WebP.
- Lazy loading everything: Applying lazy loading to the hero image delays what visitors see first.
- Sliders with massive images: All slides load simultaneously even if the visitor only views the first one.
- Missing dimensions: Images without defined width and height attributes cause layout shifts during loading.
Most of these errors are identified in a single speed test. Once fixed, your pages load faster without any changes to your design or content.
Recommended image compression tools
- Squoosh: A free browser-based tool for manually comparing different formats and quality levels.
- WordPress compression plugin: Compresses images during upload and can convert them to WebP.
- Image CDN services: Deliver the ideal format and size to every browser automatically.
- Editing software: Export images for the web using pre-set dimensions and quality levels.
Once you choose a tool, test the result on an actual mobile device. Learn more about what slows down sites and how to fix it in our WordPress speed optimization guide.
Does image compression help with SEO?
Yes, indirectly. A faster page improves user experience, and Google uses speed metrics in its ranking signals. Furthermore, images with descriptive filenames and alt text can rank in image search. See the full Google Image Search guidelines.
SGO promotes Israeli businesses on Google and AI search engines, builds and maintains websites, and develops AI agents for business. Our clients have over 3,500 keywords on Google's first page.
Is your website loading slowly?
We analyze your key pages, identify bottlenecks, and optimize images along with other performance factors. Read more about our SGO site speed service.
Frequently asked questions about image compression
Does image compression affect quality?
WebP vs. AVIF: Which is better for your website?
What size should images be for blog posts?
Why you should not lazy load hero images
Do I need a WordPress image compression plugin?
How to check if images are slowing down your site
Want more customers from your website? SGO specializes in digital marketing and SEO that drives traffic and leads.
