How can I compress a jpg images for google insights optimisation

1

I m getting this error when tring to see the speed of my website in google page speed:

Optimize images Properly formatting and compressing images can save many bytes of data. Optimize the following images to reduce their size by 20.5KiB (42% reduction). Losslessly compressing http://waybackmachinedownloader.com/en/img/home_img.jpg could save 20.5KiB (42% reduction).

I can't find how can I compress jpg images. I guess it should be with htaccess but I can't find how. This website is developed in php.

Thanks.

mohamed

Posted 2016-01-19T22:32:36.103

Reputation: 11

Jpeg is a lossy compression....http://superuser.com/questions/433659/how-to-compress-a-jpg-image-file?rq=1

– Moab – 2016-01-19T22:51:08.110

Nah this is a bug or something silly on Google's end. JPGs are already compressed and the compression is pretty damn optimal (for the quality set during JPG encoding of course). It's nonsensical to recommend compressing something that's already compressed. – misha256 – 2016-01-19T22:53:48.713

@misha256 all you can do is reduce the quality of the image to reduce size. – Moab – 2016-01-19T23:16:11.607

Answers

2

JPEG images are already compressed; any attempt to compress further with Zip, LHA or other tool rarely is of use. There are two ways to reduce the file size, both of which can be applied at the same time:

  1. Reduce the image size, e.g. scale down from 1024x768 to 800x600 pixels.

  2. Reduce the image quality. JPEG uses a lossy but fast compression scheme. If an image is saved at a lower JPEG quality setting, the file size is reduced, albeit with some loss of detail.

There are a number of free tools for different platforms such as GIMP (Linux, Windows etc.) and IrfanView (Windows, but works well in Wine) that can perform both operations on the image. Though you may need to experiment initially to find settings you find pleasing, you can standardize on those.

DrMoishe Pippik

Posted 2016-01-19T22:32:36.103

Reputation: 13 291

Worth mentioning is that if one would like to do No. 1 or No. 2, it should be done off the original uncompressed image. – misha256 – 2016-01-20T01:10:57.460