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 return JSON data to the user in Laravel?

How to block an IP range based on CIDR in Apache with .htaccess

How do you launch the PHP interactive shell?

How to force gzip compression in Apache with .htaccess

How to pick what array_intersect function to use in PHP?

What is WordPress default Apache .htaccess rules?

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

How to view all installed PHP modules?

How to order a Laravel hasMany relationship?

How to install and use optipng on Linux CentOS