The primary goal of formatting your images is to find the balance between the lowest file size and an acceptable quality. There is more than one way to perform almost all of these optimizations. One of the most popular tools ways is to simply compress them before uploading to WordPress. Usually, this can be done in a tool like Adobe Photoshop or Affinity Photo. Some of these tasks can also be performed using plugins, which we will go into more below.

The two primary things to consider are the file format and type of compression you use. By choosing the right combination of file format and compression type you can reduce your image size by as much as 5 times. You’ll have to experiment with each image or file format to see what works best.

Choose the Right File Format

Before you start modifying your images, make sure you’ve chosen the best file type. There are several types of files you can use:

  • PNG – produces higher quality images, but also has a larger file size. It only uses lossless compression.
  • JPEG – uses lossy and lossless optimization. You can adjust the quality level for a good balance of quality and file size.
  • GIF – only uses 256 colors. It’s the best choice for animated images. It only uses lossless compression.

There are several others, such as JPEG XR and WebP, but they’re not universally supported by all browsers. Ideally, you should use JPEG (or JPG) for images with lots of color and PNG for simple images.

Compression Quality vs Size

Here is an example of what can happen you compress an image too much. The first is using a very low compression rate, which results in the highest quality (but larger file size). The second is using a very high compression rate, which results in a very low-quality image (but smaller file size). Note: The original image untouched is 2.06 MB.

Low compression (high quality) JPG – 590 KB

 

High compression (low quality) JPG – 68 KB

 

As you can see the first image above is 590 KB. That is pretty large for one photo! It is generally best if you can keep a webpage’s total weight under 1 or 2 MB in size. 590 KB would be a fourth of that already. The second image obviously looks horrible, but then it is only 68 KB. What you want to do is find a happy medium between your compression rate (quality) and the file size.

So we took the image again at a medium compression rate and as you can see below, the quality looks good now and the file size is 151 KB, which is acceptable for a high-resolution photo. This is almost 4x smaller than the original photo with low compression. Typically simpler images like PNGs should be under 100 KB or less for best performance.

Medium compression (great quality) JPG – 151 KB

 

Lossy vs Lossless Optimization

It is also important to understand that there are two types of compression you can use, lossy and lossless.

Lossy – this is a filter that eliminates some of the data. This will degrade the image, so you’ll have to be careful of how much to reduce the image. The file size can be reduced by a large amount. You can use tools such as Adobe Photoshop, Affinity Photo, or other image editors to adjust the quality settings of an image. The example we used above is using lossy compression.

Lossless – this is a filter that compresses the data. This doesn’t reduce the quality but it will require the images to be uncompressed before they can be rendered. You can perform a lossless compression on your desktop using tools such as Photoshop, FileOptimizer, or ImageOptim. Some plugins will apply Gzip compression to images (minify them).

It’s best to experiment with your compression techniques to see what works best for each image or format. If your tools have the option make sure you save the image for web. This is an option in many image editors and will give you the quality adjustments so you can perform optimal compression. You’ll lose some of the quality, so experiment to find the best balance you can without making the images ugly.

Image Optimization Tools and Programs

There are a lot of tools and programs out there, both premium and free, that you can use to optimize your images. Some give you the tools to perform your own optimizations and others do the work for you. We are personally big fans of Affinity Photo, as it is cheap and gives you almost identical features to that of Adobe Photoshop.

Here are some additional tools and programs to check out:

 

Image Optimization Plugins You Can Use

Thankfully, with WordPress, you don’t have to do all of the formatting or compression by hand. You can use plugins to do at least some of the work for you automatically. There are several plugins that will automatically optimize your image files as you upload them. They’ll even optimize images that you’ve already uploaded. This is a handy feature – especially if you already have a website filled with images. Here’s a look at some of the best plugins to format your images for better performance.

It is important though that you don’t solely rely on the plugins themselves. For example, you shouldn’t be uploading 2 MB images to your WordPress media library. This can result in eating up your web hosts disk space really fast. The best method is to quickly resize the image in a photo editing tool beforehand, and then upload it and use one of the following plugins to reduce it further.

Imagify Image Optimizer

Imagify is created by the same team who developed WP Rocket, which most of you are probably familiar with. It is WooCommerce, NextGen Gallery, and WP Retina compatible. It also has a bulk optimization feature and you can choose between three different levels of compression, normal, aggressive, and ultra. It has a restore feature as well, so if you are unhappy with the quality you can one-click restore and re-compress at a level which better suits your needs. There is a free and a premium version. You are limited to a quota of 25 MB of images per month with a free account.

Getting rid of the original image and resizing your larger images can also be done with this plugin.

Imagify also compresses images on their third-party servers, not yours, which is very important when it comes to performance. Imagify shouldn’t slow down your WordPress site.

 

ShortPixel Image Optimizer

ShortPixel Image Optimizer is a free plugin that will compress 100 images per month and will compress multiple types of files including PNG, JPG, GIF, WebP, and even PDF files. It will do both lossy and lossless image compression. It will convert CMYK to RGB. It takes your images and thumbnails into the cloud for processing and then brings them back to your site to replace the originals. It creates a backup of the original files so you can manually restore them if you want. It will convert gallery files in bulk. There is no limit to the file size.

 

Optimus Image Optimizer

The Optimus WordPress Image Optimizer uses lossless compression to optimize your images. Lossless means you won’t see any quality loss. It supports WooCoomerce and multi-site and has a nice bulk optimization feature for those with already large existing media libraries. It also is compatible with the WP Retina WordPress plugin. There is a free and premium version. In the premium version you pay once annually and you can compress an unlimited amount of images. If you combine it with their Cache Enabler plugin you can also dive into WebP images, which is a new lightweight image format from Google.

 

WP Smush

WP Smush has both a free and premium version. It will reduce the hidden information from images to reduce the size without reducing quality. It will scan images and reduce them as you upload them to your site. It will also scan images that you’ve already uploaded and reduce those too. It will bulk smush up to 50 files at once. You can also manually smush if you want. It will smush JPEG, GIF, and PNG image types. File sizes are limited to 1MB.

  • It’s compatible with some of the most popular media library plugins such as WP All Import and WPML.
  • All image optimization is done with lossless compression techniques, keeping your image quality high.
  • It doesn’t matter which directory you save your images in. Smush finds them and compresses them.
  • Smush has an option to automatically set width and height for all images, so all of your images get resized to identical proportions.

TinyPNG (also compressed JPGs)

TinyPNG uses the TinyJPG and TinyPNG services (the free account lets you compress around 100 images per month) to optimize your JPG and PNG images. It will automatically compress new images and bulk compresses your existing images. It will convert CMYK to RBG to save space. It will compress JPEG images up to 60% and PNG images up to 80% without a visible loss in image quality. It does not have a file size limit.

 

ImageRecycle

The ImageRecyle plugin is an automatic image and PDF optimizer. This plugin focuses on not only image compression but PDFs as well. One really handy feature is the ability to set the minimum file size for compression. For example, if you have images that are 80 KB in size, you can have it automatically exclude them from compression. This ensures images and files are never compressed too much. It also includes bulk optimization and auto image resizing. Note: They have a free 15-day trial, but this is a premium service, and images are uploaded and compressed using their servers. They don’t charge per month, but rather by the total number of images compressed, starting at $10 for 10,000.