optipng for image optimization

Last time We were talked about jpegoptim and jpegtran. Today we will talk about OptiPNG. OptiPNG is 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. 

Installation

Check standard packages:

apt-get install optipng
How to use

Single file optimization

optipng test.png

In order to optimize all the files in the images directory:

find public / images / -iname * .png -print0 | xargs -0 optipng -o7

That’s all.

You can read more linux guides by link https://linuxnotes.org/category/linux-how-to/

Leave A Comment