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

What is the difference between ( for ... in ) and ( for ... of ) in javascript?

How do you access the php://input stream?

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

How to get the first row that matches some where queries, or create it if it doesn't exist (in Laravel's Eloquent)?

How to show (or log) all SQL queries executed by Laravel

How to use Anonymous classes in PHP 7?

What is snake case?

How to replace whitespace with a single space

How to check if a relation was loaded on an Eloquent model already?

How to run an artisan command from a controller