I am looking for a way in which I can do a lossless compression of all images in a directory in a batch process. I don't want images to loose quality.
I am running this website Winni.in, for this if you check in google's pagespeed tool, it suggests you to optimize images using lossless compression. For new product's images I can make changes in my algorithm of image saving but for existing images of products I need a way by which I can run a command which can do lossless compression for all images of products residing in a directory.
EDIT: Please see this site report http://gtmetrix.com/reports/www.winni.in/PzJBF0rW
Here you can find optimize images point in 5th suggestion, there you can see it is listing number of jpeg images to losslessly compress. If you optimize your images from an online image optimization utility like kraken.io then this warning is gone.