PageSpeed Insights

Optimize Images

This rule triggers when PageSpeed Insights detects that the images on the page can be optimized to reduce their size without significantly impacting their visual quality.

Overview

Keep image sizes to a minimum to reduce the amount of time a user is waiting for resources to load. Properly formatting and compressing images can save many bytes of data. This saves time for users on slow connections and money for users on limited data plans.

Recommendations

You should perform both basic and advanced optimization on all images. Basic optimization includes cropping unnecessary space, reducing color depth to the lowest acceptable level, removing image comments, and saving the image to an appropriate format. You can perform basic optimization with any image editing program, such as GIMP. Advanced optimization involves further (lossless) compression of JPEG and PNG files.

Use an image compressor

Several tools are available that perform further, lossless compression on JPEG and PNG files, with no effect on image quality. For JPEG, we recommend jpegtran or jpegoptim (available on Linux only; run with the --strip-all option). For PNG, we recommend OptiPNG or PNGOUT.

Choose an appropriate image file format

You should test which format is best for your image, although we some high level recommendations here:

  • PNGs are almost always superior to GIFs, although some older versions of browsers may only have partial support for PNG.
  • Use GIFs for very small or simple graphics (e.g. less than 10x10 pixels, or a color palette of less than 3 colors) and for images which contain animation.
  • Use JPGs for all photographic-style images.
  • Do not use BMPs or TIFFs.

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.