Running Google Page Speed on a public site , I saw some suggestions by the tool like the following :
Losslessly compressing http://g-ecx.images-amazon.com/images/G/01/electronics/detail-page/Acer-120x120._V137848950_.gi could save 4.8KiB (26% reduction) and they also provide a link to the optimized content.But they do it on a per image basis. I saw some significant reduction on file sizes after compression. So the question is :
Is there any tool or web service that I can use so that I give it a directory of uncompressed images(say .gif) and it returns me a directory of images with all of them compressed?
I found a somewhat related question on SO here but it is not an exact duplicate.
Thanks for reading.
On the Mac, I've had good success with ImageOptim. It handles PNG, JPEG, and GIF files in a drap & drop manner and can also process entire directories. It's also open-source and available in multiple languages.
On Windows, I've used both PngOptimizer and PNGGauntlet. Unlike ImageOptim, these programs will convert other formats to PNG, so if your goal is to reduce a GIF or JPEG and have it stay in that format, these won't be an option.
You could also try the Yahoo web site/service smush.it which can handle single file uploads as well as a directory zip.
The best tool for losslessly compressing images for the web (JPG, PNG and GIF) is FileOptimizer. It can compress images up to 10% of its original size sometimes. A few of the better online tools are this compressor for PNG's and this one for JPG's.
I would go with the FileOptimzer if you have a lot of images though. If you have just a few it's easier to use the online tools.
I recently started using lossless Jpegoptim (GitHub) and I get the best results with this tool, very often close to Google Page Speed suggestions and sometimes even better.
I'm on Linux so if I navigate to the folder with the images I simply use this command to compress all images:
jpegoptim *.jpg -s
Or use this if you want to compress only specific image:
jpegoptim image.jpg -s
It basically strips all the markers from the output file which can sometimes reduce the image size even for 50%! The image quality stays the same.
I am currently using highcompress and this one is my favorite because the best part is quality and size. I have compared with many online tools and in most of the cases it gives best compression and best quality so now I don't go here and there and directly use this. If any other better you know kindly share
来源:https://stackoverflow.com/questions/11221607/tool-for-lossless-image-compression