mod_deflate compresses lossless by definition, so you could just add the file types there.
The question is whether you’d really want to, seeing as images are usually pretty compressed as it is. Have you tried ZIPping a JPEG and noted the ZIP was actually bigger than the JPG itself?
Maybe it could help a bit for PNG and GIF, but the amount of processor you’d need to compress those images does not weigh up to the few bytes you’d safe.
Well according to Google Speed Test, it will save my pages approximately 1MB in filesize if I compress my images even more. I use Photoshop to make the images, and save for web using transparent .png mostly, but there is also a PHP image uploader that is used to upload images in the backend of the website. I wonder if this is adding filesize to the images…
Couple of quick questions:
-Is there a way to do a batch compression on all of my site images? (I will just go into FTP, download them, bath lossless compression, re-upload, and fix the PHP script).
-Which program would you recommend for Mac on lossless compression on jpg, png and gif files? Better yet, maybe there is a script that can do this one time for me?
I think the google tool is indicating that it would be good to optimize the images further by optimizing the images themselves, not by serving them through mod_deflate.
I have never actually used it myself, but I’ve heard good things about smush.it, which is a website that can be used to batch optimize a bunch of images. You could give that a whirl
Also, in PHP you can define the compression ratio when you save images, which is also interesting to look it. Take care when you look at that though that different image types have different ranges. If I’m not mistaken the range for JPG is from 0 to 100, PNG from 1 to 9 and GIF doesn’t have any options at all.
Also, keep in mind that (at least for JPG) more compression means less quality. So while you might be tempted to set the quality to say 50 for compression reasons, it’s probably not the best idea to use that setting for aesthetic reasons.