Jpegotim compression jpg picture
Install Jpegotim
If you have a epel yum source, use the following command
The code is as follows:
# yum Install Jpegoptim
Compress picture Commands
Ttlsa.jpg 1425x823 24bit N JFIF [OK] 1074449--> 853514 bytes (20.56%), optimized.
You can see that the ttlsa.jpg is automatically compressed by 20.56%.
Compress once more
Ttlsa.jpg 1425x823 24bit N JFIF [OK] 853514--> 853514 bytes (0.00%), skipped.
The picture has been compressed, so the prompt skips and does not need to be compressed.
Provides a script for bulk compression
For I in/data/site/image.ttlsa.com/images/*.jpg; Do Jpegoptim $i; Done
Pngcrush to optimize PNG pictures
Project Address: http://pmt.sourceforge.net/pngcrush/
# wget http://downloads.sourceforge.net/project/pmt/pngcrush/1.7.88/pngcrush-1.7.88.tar.gz
# TAR-XZVF Pngcrush-1.7.88.tar.gz
# CD pngcrush-1.7.88
# make
# CP Pngcrush/usr/bin
Pngcrush using syntax
Usage:pngcrush [Options except FOR-E-d] infile.png outfile.png
PNGCRUSH-E ext [Other options] file.png ...
Pngcrush-d dir/[Other options] file.png ...
Pngcrush-ow [Other options] file.png [Tempfile.png]
Pngcrush-n-V file.png ...
Options
-bail (bail out of trial when size exceeds best size found
-bit_depth Depth (deprecated)
-blacken (zero samples underlying fully-transparent pixels)
-brute (use Brute-force:try 148 different methods)
........ More content please see Help yourself ...
Pngcrush Simple Command
Pngcrush-brute-e "Myimage_compressed.png" myimage.png
......... Omitted.....
Best Pngcrush method = 123 (WS FM 4 ZL 9 ZS 1) = 124820
For output to Ttlsattlsa_new.png
(1.63% critical chunk reduction)
(1.63% filesize reduction)
CPU time decoding 1.560, encoding 7.640, other 0.030, total 9.230 sec.
Bulk optimize PNG pictures
Pngcrush-brute-d "/data/site/image.ttlsa.com/images" *.png