jpegtran for image optimization

jpegtran is a libjpeg command-line utility. It allows you to manipulate JPEG files, but its most useful function is optimization.

Installation of jpegtran

For Linux, this utility is usually found in packages:

apt-get install libjpeg-progs


For the basic version of optimization, we call the command:

jpegtran -copy none -optimize -outfile min.image.jpg image.jpg
save the optimized copy to min.image.jpg

-copy none removes all metadata from the source file
-optimize optimizes image


To change the format to progressive, use the following command:

jpegtran -progressive -copy none -optimize -outfile image.jpg

save the result to the file

Quality change
You can also specify the compression ratio to visually select the best value:

jpegtran -quality 80 -copy none -optimize -outfile image.jpg

Try different values ​​from 5 to 95.

You can read more linux guides by link

Viva La Linux!

Leave A Comment