When working with a lot of images by example for galleries on a website, it could be really interesting to optimize the images to save a lot of space and directly improve the performances of the website and save some traffic if this is limited by your hosting.
sudo apt-get install jpegoptimAnd it's also really simple to use. First, to optimize an image without loss :
jpegoptim image.jpgOr with a loss of max 25% :
jpegoptim --max=75 image.jpgMore informations on the official site.
sudo apt-get install optipngIt's as easy as the first tool :
optipng image.pngYou can also configure the tool to use the best optimization level, but also the slowest :
optipng -o7 image.pngSo here we are : You have now enough informations to optimize all you images on Ubuntu. I hope this will be useful to somebody.