Compress images in a directory losslessly. This runs from command live, but you still need x server, because it requires QT. That means, you are not able to run this on a headless machine(command line only). Trimage itself is a cross-platform GUI and command-line interface for optimizing images for websites. It is using optipng, pngcrush, advpng and jpegoptim. It supports jpg's and png's. I do not suggest the gui tool. It has some problems with bigger amounts of files. The command-line interface works perfectly tough.
Source code viewer
trimage -d /my/dir/of/imagesProgramming Language: Bash