Most tidy webp

via: https://developers.google.com/speed/webp

Download via: https://developers.google.com/speed/webp/docs/precompiled

$ sudo apt install webp
$ cwebp -q 50 -lossless picture.png -o picture_lossless.webp
$ cwebp -q 70 picture_with_alpha.png -o picture_with_alpha.webp
$ cwebp -sns 70 -f 50 -size 60000 picture.png -o picture.webp
$ cwebp -o picture.webp picture.png
# https://developers.google.com/speed/webp/docs/cwebp

JEPG jpegoptim

jpegoptim --size=1024k xxx.jpg

PNG

(lossy compress) pngquant

via: https://pngquant.org/

optipng

via: https://optipng.sourceforge.net/

a PNG optimizer that recompresses image files to a smaller size, without losing any information. This program also converts external formats (BMP, GIF, PNM and TIFF) to optimized PNG, and performs PNG integrity checks and corrections.”

用 optipng 压缩过的图片合成 == 未用 optipng 压缩过的图片合成(对比两个文件的哈希值都一样)

optipng -o3 image.png -out output.png
# `-o0`~`-o7`,级别越高压缩率越高但速度越慢