Large, uncompressed images are one of the most common reasons a website feels slow, especially for visitors browsing on mobile data. Optimizing your images before you upload them, and cleaning up the ones already on your site, can noticeably speed up page load times without changing anything else about your website.
Why Image Size Matters
A single photo straight from a phone or camera can be several megabytes in size. When a page loads five or six of these unoptimized images, visitors on a slow mobile connection may wait a long time for the page to finish loading, and some will leave before it does. Smaller image files also reduce the bandwidth your hosting account uses each month.
How to Check Which Images Are Slowing Down Your Site
Before optimizing anything, it helps to know which images are the biggest problem. Open your website in a browser, right-click any image, and choose Open Image in New Tab (or a similar option depending on your browser) to see its file size and dimensions. As a general rule:
- Any single image over 300-500 KB is a good candidate for compression.
- Images displayed at a small size on the page, like thumbnails, but uploaded at full camera resolution are wasting bandwidth.
How to Compress Images Before Uploading
The most effective place to optimize an image is before it ever reaches your website. Use a free online image compression tool, such as TinyPNG or Squoosh, or an image editor on your computer, to reduce file size before uploading. Follow these steps:
- Resize the image to the actual dimensions it will display at on your website. There is rarely a reason to upload a 4000-pixel-wide photo for a banner that only displays at 1200 pixels wide.
- Run the resized image through a compression tool. Most tools let you drag and drop a batch of images and download them all compressed at once.
- Compare the compressed file to the original. A well-compressed photo should look nearly identical but be a fraction of the original file size.
Always keep an unedited copy of your original photos somewhere safe. Compression is generally not reversible, so you don't want to compress your only copy of an important image.
Choosing the Right Image Format
- JPEG is best for photographs and images with many colors.
- PNG is best for logos, icons, and images that need a transparent background, but produces larger files for photos.
- WebP produces smaller files than both JPEG and PNG at a similar quality and is supported by all modern browsers, making it a good default when your website platform supports it.
If Your Website Runs on WordPress
Image optimization plugins such as Smush or ShortPixel can automatically compress images as you upload them, and can also work through your existing media library to compress images you uploaded in the past. Install one from your WordPress dashboard under Plugins, then Add New, and follow the plugin's setup wizard.
Uploading Your Optimized Images
Once your images are compressed, upload them the same way you normally would: through your website's content management system, or directly via your hosting control panel's File Manager if you manage files manually. There is no difference in how cPanel and DirectAdmin handle image files themselves, only in how you reach the File Manager to upload them.
If your website still loads slowly after optimizing your images, see How to Speed Up a Slow-Loading Website for other factors that affect load time.