When running a website through Google PageSpeed Insights I get the following response:

Optimize images

Properly formatting and compressing images can save many bytes of data.

Optimize the following images to reduce their size by XX.XKiB (X% reduction).

Losslessly compressing http://www.website.com/path/to/image/image_file.jpg could save XX.XKiB (XX% reduction).

What do the tool mean by "Losslessly compressing?" Sounds like I could reduce the filesize without sacrificing image quality; but how?


In short, this means stripping out parts of the file that aren't required to display the image. For example, JPEG files may include EXIF data that contains information such as the make of camera used to take the photo. For PNGs it can also mean using different compression parameters that will yield better results for that specific file.

Free tools such as Trimage or ImageOptim make all this easy for you. Just give it an image (or folder of images), and it will spit out a losslessly optimised version.

  • Thanks, I'm going to give this a try and see what happens. – Drewdavid Apr 28 '15 at 18:40

Its a way to say compress your images.

Easiest way is to use an art program and save the image at a quality lower than 100%. Usually 60% to 70% quality is acceptable to much of the world. Anything lower than 60% and you'll notice some blur in some spots of the image.

If you use PHP, what you can do is load the image within it, and then output the image but with a lower quality like this:

header("content-type: image/jpeg",true);

The above outputs takes an image from the server computer and displays it on the screen at 75% of the normal quality. Check the file size of the new image within your browser and you'll notice the download size is less compared to the original image.

  • This is lossy compression, not lossless. – Tim Fountain Apr 27 '15 at 23:57
  • -1 because this answer doesn't take into consideration the lossless part of the question. – Seb May 24 '16 at 18:57

Not the answer you're looking for? Browse other questions tagged or ask your own question.