How to install and use jpegoptim on Linux CentOS

CentOS and Linux Stuff: How to install and use jpegoptim on Linux CentOS

If you have a bunch of jpgs that you want to optimise, you will probably want to use jpegoptim. Here is how to install it on Linux CentOS

yum install jpegoptim

How to use jpegoptim on Linux CentOS

The syntax for using jpegoptim is simple - jpegoptim yourImage.jpg. Of course, there are some options you can pass to it.

How to use jpegoptim on Linux CentOS to optimise all images (recursively) in a directory

Use the following command to automatically recursively go through the current directory (and all subdirectories/folders) and optimise the jpg image, lowering its file size. You won't notice any difference in quality, but it will strip all useless information stored in the jpg's meta data

find . -name "*.jpg" -exec jpegoptim -m80 -o -p --strip-all {} \;

You should also see my page explaining how to do the same thing but for png images

webdevetc profile pic
webdevetc

I am a 29 year old backend web developer from London, mostly focusing on PHP and Laravel lately. This (webdevetc.com) is my blog where I write about some web development topics (PHP, Laravel, Javascript, and some server stuff). contact me here.



More...


Comments and discussion about How to install and use jpegoptim on Linux CentOS

Found this interesting? Maybe you want to read some more in this series?

Or see other topics in the CentOS and Linux Stuff language

Or see other languages/frameworks:
PHP Laravel Composer Apache CentOS and Linux Stuff WordPress General Webdev and Programming Stuff JavaScript
Or see random questions

How to convert a string to an array of it's characters in PHP?

What are the SPL data structures

How to block an IP address in .htaccess

What are Apache MPMs?

PHP Date commonly used formats

How to fix the MySQL related "Specified key was too long error" error in Laravel

How to set custom HTTP headers in Apache (by editing .htaccess)

How to replace values in a string, in JS

How to convert between types in JS?

How to generate an array for a dropdown (with ['key' => 'value']) suitable for a dropdown, from a Laravel collection of Eloquent objects?