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 camel case?

How to sort an array in javascript?

How to add a name prefix to all routes in a group?

How to make multiple routes share the same URL structure or URL parameters

How to Force www or non-www in htaccess

301 Redirect a single URL in .htaccess to a new location

How to output (echo/print) content in PHP

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

How to block IPv6 IP addresses in .htaccess

What is Bubble sort, and how to write an implementation of it in PHP