DreamHost ACADEMY

Grow

You’ve done the hard work of building a website and cultivating an audience. You deserve to get a return on your time and investment — don’t you think?

How to Optimize Your Site’s Images for Better Performance (7 Key Tips)

From visualizing data to illustrating ideas and concepts, images can be invaluable additions to your website’s content. However, they can also increase the weight of your pages, causing them to slow down.

Fortunately, you simply need to take a few straightforward steps to optimize your images and improve your site’s performance. Not only will this reduce the amount of space you’ll need to store your images, but you’ll also consume less of your users’ bandwidth — leading to a better overall User Experience (UX).

This article will discuss what image optimization is and how it benefits your site’s performance. Then we’ll share seven tips you can use for effectively optimizing images. Let’s get to it!

What Image Optimization Is (And Why It’s Crucial for Your Site’s Performance)

The image optimization process is used to decrease file size without losing quality — or without losing so much quality that it’s noticeable to the average visitor. The goal is to reduce the overall page size and improve loading speed.

Why is this important?

In short, a slow website is the bane of any business, and it can increase your abandonment rates. Think of a visitor impatiently waiting for a blog post to load or an e-commerce checkout page to fully render.

Considering the increasingly short attention spans of users, it’s incredibly vital to ensure your site loads in a matter of seconds. Google industry benchmarks reveal that even an uptick from one second to three seconds in page load time increases bounce probability to 32%. If a page takes up to five seconds to load, the bounce probability jumps to 90%!

Optimizing your images can lead to opportunities to increase revenue and reduce business costs. For example, it can help you maximize your hosting provider’s bandwidth, so you don’t have to spend more than what’s necessary.

Increased page loading speeds can also improve the mobile UX for your visitors. In turn, this can boost your Search Engine Optimization (SEO) since Google uses mobile-first indexing to rank your site.

Additionally, optimized images can result in faster backup times. This can be especially handy if you ever need to replicate your site or migrate to a new hosting provider. The extra time saved (especially if you’re running a one-man show) can be invested in the more crucial aspects of your business.

Why Is My Website Slow?

Maybe you’re working with the wrong web host. We’ll make sure your website is fast, secure, and always up so your visitors trust you. Plans start at $2.59/mo.

How to Optimize Your Site’s Images for Better Performance (7 Key Tips)

Keeping the visual appeal and performance of your site in balance can be challenging. To make it easier, we’ve put together a list of seven key tips that can help you optimize your images.

1. Benchmark the Current Speed of Your Site

Although it might be tempting to jump straight to optimizing your images, the first thing you’ll want to do is to measure your site’s current speed. This can help you assess just how much work will be involved in improving your site’s performance and identify which specific tasks to prioritize.

To test your site’s speed, you can use free tools such as Google PageSpeed Insights or Pingdom Tools. To use either of them, simply enter your website’s URL and run the test. We’ll illustrate the process using PageSpeed Insights.

First, enter your site’s URL into the input box provided and click on Analyze. This will automatically bring you to the results page.

Testing page speed with the PageSpeed Insights tool.

In addition to your performance score, you’ll be offered suggestions for actions you can take to improve the site’s performance. For example, in this test, the tool suggests resizing images as well as serving them in next-gen formats.

Tips for improving site speed provided by PageSpeed Insights.

You can test both mobile and desktop pages. By default, PageSpeed Insights loads the Mobile tab. However, you can switch by clicking on the Desktop tab at the top of the page.

Tips for improving site speed provided by PageSpeed Insights.

You may notice a different score and results.

Testing page speed with the PageSpeed Insights tool.

If your scores are suboptimal, the suggestions provided give you a solid starting point for improving your site’s speed and performance. In many cases, optimizing images will be included in the list of recommendations.

2. Choose the Best Image File Format for Your Needs

One of the best ways to keep your images’ file sizes in check is to use the appropriate format for your specific needs. There are different image file types you can use, and each has its pros and cons. Some take up less space, while others retain the original quality and image data.

The most common examples of file formats include JPEG, PNG, GIF, and WebP.

A JPEG (Joint Photographic Experts Group), also commonly referred to as JPG, can display millions of colors and is generally best for complex photography or designs containing people, places, or things.

The PNG (Portable Network Graphics) format tends to produce high-quality images but usually has larger file sizes. Although it supports millions of colors like the JPEG, this type is better suited for images with less color data. PNGs are typically a great choice when you need to take screenshots of user interfaces (UI), which often transition between colors rapidly.

Another common image format is GIF (Graphics Interchange Format). This type is popular on social media for sharing memes, whether static or animated. Unlike JPEGs or PNGs, which can display millions of colors, GIFs are capped at a maximum of 256 colors. If maintaining quality is critical, it’s usually not a smart idea to convert images to GIFs. However, it’s worth noting that GIFs are usually smaller than JPEGs or PNGs, making them a practical choice when considering loading speed.

The final image format we’ll consider is WebP, which was developed by Google. The quality of WebP images is comparable to JPEGs and PNGs. However, WebP compression offers an advantage in that it uses 25–34% less space. Nowadays, this file type is supported by most major browsers, making it a decent choice if you’re looking to optimize your site’s performance.

3. Resize Your Images Before Exporting

Another way to optimize your images is to resize them before you export and upload them to your WordPress site. This method can be especially handy when you’re working with raw images from a DSLR camera, which can produce photos in much larger dimensions than you need.

It’s best to resize images to the exact dimensions. For example, uploading an image 3600 pixels (px) wide for a banner with a maximum display width of 1200px is unnecessary.

As we’ve noted, excessively large image sizes can increase your site’s loading times, leading to higher abandonment rates and poor UX. To resize or scale down your images, you can use tools such as Photoshop, GIMP, or Pixlr.

Regardless of which editing tool or software you use, resizing and scaling images before you save and export them can significantly reduce their file sizes. For example, below is a JPG image with original dimensions of 9600 x 5400px. Saving it as-is would result in a file size of 7.6 megabytes (MB).

Saving an image in Pixlr with its original dimensions.

When we resize the image dimensions to 1200 x 675px, the file size decreases to 158 KB.

A resized JPG image in Pixlr with reduced file size.

The process of resizing and scaling images is similar no matter what tool you use. For example, with GIMP, you can navigate to Image > Scale Image.

Finding the GIMP menu option for scaling images.

In the window that opens, you can enter a new width and height. For your X and Y resolution, you generally want to keep the values the same.

Entering dimensions for resizing an image in GIMP.

It’s also important to maintain the image’s aspect ratio to avoid ending up with a distorted image. However, if you want to change it, just click on the chain symbol beside the input boxes for the sizes. This will let you adjust the width and height separately.

4. Compress Images to Reduce File Size

Another way to optimize images is by compressing them, which is possible through either lossy or lossless compression. As with the different image formats, each compression type has its pros and cons.

Lossy compression reduces the size of an image but also decreases its quality. Two of the formats we considered earlier, JPEGs and GIFs, are lossy formats. However, the difference in quality after the compression process, for JPEGs especially, is usually so subtle that it’s unnoticeable by the human eye.

Lossless compression, on the other hand, reduces image size without losing quality, usually by eliminating unnecessary metadata in JPEGs and PNGs. However, depending on the compression algorithm used, even formats normally considered lossless can see some degradation in quality.

Therefore, you’ll want to consider your specific needs when choosing the type of compression to use. Thankfully, most image optimization tools make intelligent choices based on image content.

One of the most popular image compression web tools you can use is TinyPNG.

The TinyPNG website.

You can easily upload your image, and this tool will automatically compress it, presenting you with an optimized version to download and use. There is also a TinyPNG WordPress plugin available.

Once your image is uploaded to WordPress, TinyPNG applies a suitable optimization algorithm based on image content, then replaces the original file with the compressed artifact. You can also perform bulk optimizations on your existing images by navigating to Media > Bulk Optimization.

The option to bulk optimize images in WordPress via the TinyPNG plugin.

Another solid image compression tool you might consider is PNGGauntlet.

The PNGGauntlet compression tool.

This solution combines a variety of tools and uses lossless compression to create small PNG files. The image formats supported for conversion to PNG are JPG, GIF, TIFF, and BMP.

PNGGauntlet is available as a desktop application for the Windows platform. However, there are alternatives for Mac and Linux, such as ImageOptim and Trimage, respectively.

Get Your Site Up to Speed

With 20+ years of experience supporting millions of sites, we’ve perfected a process to make your website super fast at an affordable price.

5. Automate Image Optimization Using a WordPress Plugin

Optimizing a single image is relatively easy, but repeating the process every time you upload an image to your site can be tedious. Rather than performing image optimization manually, you can automate it by using a WordPress plugin.

As we mentioned, TinyPNG helps compress and optimize images in bulk. However, there are a handful of other quality options to consider. One is Optimole.

The Optimole WordPress plugin.

Optimole automatically creates responsive images by taking end-user devices into account during the optimization process. It supports all image types and serves them from a global Content Delivery Network (CDN). This plugin doesn’t replace original images with optimized versions. Instead, on-the-fly transformations are performed as required.

Another popular WordPress plugin worth checking out is EWWW Image Optimizer.

The EWWW Image Optimizer plugin.

This tool uses Easy IO, a fully-automatic image optimization service, to process any image displayed on your web pages. As with Optimole, it routes images through a CDN and provides device-based optimization. It also includes a lazy load feature, which we’ll discuss momentarily.

If you’re looking for a WordPress plugin that offers multiple types of compression, you might consider using Imagify.

The Imagify plugin.

Imagify uses three levels of compression: normal (lossless), aggressive (lossy), and ultra (also lossy). This tool automatically optimizes your images and thumbnails when you upload them into WordPress and offers a Bulk Optimizer to optimize existing images.

A final WordPress image optimization plugin that gets a lot of praise is ShortPixel.

The ShortPixel plugin.

As with the other plugins mentioned, it optimizes your images automatically upon upload. ShortPixel uses both lossy and lossless compression for formats such as JPEG, PNG, GIF, and WebP. It also uses glossy JPEG compression, which is designed specifically for photographers.

6. Load Lower Quality Images Using the “Blur Up” Technique

When it comes to image optimization techniques, you can employ certain methods to give your visitors the impression of fast load times. One of these is what’s known as the “blur up” technique, which is also sometimes referred to as “progressive images.”

This strategy involves loading images of much lower quality first and then swapping them out later for the high-quality images. This is so that your site visitors aren’t staring at a completely blank page or empty placeholder box where an image should be.

Without getting too technical, this technique takes a tiny version of the image (usually around 40px) and then scales it up. It also applies a gaussian blur, which gives it an out-of-focus look until it’s fully loaded.

For example, below is an image that is scaled up and has the gaussian blur applied.

A low-quality image loaded using the ‘blur up’ technique.

However, once the image is fully loaded, it would look like this:

A high-quality image of pink flowers.

By loading a smaller or “blurred” image before the larger-sized one, your visitor is given the perception of faster loading times. They also realize that an image will appear, even if it takes a moment or so for it to come into full focus.

The one downside to this strategy is that it can be a bit technical to execute and requires some basic CSS knowledge. However, if you’re up for it, you can find detailed guidance and instructions on using the “blur up” technique on CSS-Tricks.

7. Implement Lazy Loading on Your Site

Another image optimization technique that can help increase loading times is lazy loading. In a nutshell, this method delays the loading of images until the visitor scrolls down to the part on the page where the image is located.

Lazy loading offers a way of loading images on a page in sequential order rather than all at once. This reduces HTTP requests sent to the server, making it easier to load content on the page faster.

A popular WordPress plugin you can use to implement lazy loading on your site is WP Rocket’s Lazy Load.

The LazyLoad plugin.

The Lazy Load plugin displays images on the page only when they’re currently visible to your users. Once you install and activate it, you can use the plugin to lazy load thumbnails, images in posts and widget text, and more. Best of all, the script used to perform all of this is lightweight — barely 10KB.

If the user’s browser has native lazy loading features, you can use that feature. However, this involves editing your site’s files and adding code. If you’re comfortable with that, you can add the following line to the functions.php file of your current theme:

add_filter( ‘rocket_use_native_lazyload’, ‘__return_true’ );

To find your functions file, you can navigate to Appearance > Theme Editor from your WordPress dashboard.

The Theme Editor in WordPress.

The functions.php file will be listed to the right. You can also access it via the File Manager or a Secure File Transfer Protocol (SFTP) client.

Keep in mind that if you use another image optimization plugin on your website, you may not need a dedicated lazy load plugin. For example, as you might recall, Optimole comes with built-in lazy load features.

Ready to Supercharge Your Load Speed

Whether you need help compressing images, using a CDN, or optimizing your database, we can help! Subscribe to our monthly digest so you never miss an article.

The Beauty of an Optimized Image

Decorative images spice up the web. From online galleries to portfolios, they can help enhance your web pages’ appearance and boost overall UX for your visitors. However, if they’re not optimized, quality images can be heavy and lead to slow loading times, which ultimately hurts your site speed and performance.

In this article, we discussed seven tips for optimizing your site’s images:

  1. Benchmark the current speed of your site.
  2. Choose the best image file format for your needs.
  3. Resize your images before exporting them.
  4. Compress images to reduce file size using a tool such as TinyPNG.
  5. Automate image optimization using a WordPress plugin such as Optimole.
  6. Load lower quality images using the “blur up” technique.
  7. Implement lazy loading on your site.

Looking for a high-performance and hassle-free hosting option for your website? DreamPress makes it easy to manage your site and provide a smooth user experience for your visitors!

Image credit: Pexels.

We’re Here to Help

If you have questions or just could use some help figuring some thing out, get in touch. Our team of web experts has been in the business for over 20 years and knows how to help you figure out the right next steps.