How to install Mozjpeg in Linux Mint 19

Share this post to your friends !
  • 1
    Share

How to install Mozjpeg in Linux Mint 19
5 (100%) 1 vote[s]

DanieBlog - This article will guide you how to install Mozjpeg in Linux Mint 19.

If you do not know what Mozjpeg is, you will know one more useful software through this article.

What is the Mozjpeg project?

Mozjpeg is a project of Mozilla. According to the homepage:

MozJPEG reduces file sizes of JPEG images while retaining quality and compatibility with the vast majority of the world’s deployed decoders.

You can read more about Mozjpeg’s features at this github link.

Basically for me, I use it to compress the images that I will upload to my blog.

Step-by-step to install Mozjpeg in Linux Mint 19

This section will present you step by step how to install Mozjpeg successfully on Linux Mint 19.

Install dependent packages

This software will need some of the following dependencies to work:

  • autoconf
  • automake
  • libtool
  • nasm
  • make

Now type the following command to install those dependencies.

danie@linux:~$ sudo apt-get install autoconf automake libtool nasm make -y

Download the source code

You can select their installed versions at this link, because the version may vary over time.

At the time I wrote this article, Mozjpeg has version v3.3.1.

Now type the following command to download and extract the source code.

danie@linux:~$ cd /tmp
danie@linux:~$ wget https://github.com/mozilla/mozjpeg/archive/v3.3.1.tar.gz
danie@linux:~$ tar -xzf v3.3.1.tar.gz

Compile and install the source code

First, move to the unzipped folder of the source code.

danie@linux:~$ cd mozjpeg-3.3.1/

Next, use the autoreconf command to create the configure file for the source code.

danie@linux:~$ autoreconf -fiv

And then, you create the build directory to contain the installation files. Move into the build directory.

danie@linux:~$ mkdir build && cd build

Run the configure file to create the Makefile, which will be used to install the final program on your computer.

danie@linux:~$ sh ../configure

And finally, run make install with sudo permissions so that it installs Mozjpeg into the /opt folder in your computer.

danie@linux:~$ sudo make install
how-to-install-mozjpeg-in-linux-mint-19 How to install Mozjpeg in Linux Mint 19
How to install Mozjpeg in Linux Mint 19.

Use Mozjpeg

Now, type the following command to see the executable files of Mozjpeg installed on your computer.

danie@linux:~$ ls /opt/mozjpeg/bin/
cjpeg djpeg jpegtran rdjpgcom tjbench wrjpgcom

There is a problem, if you want to use, for example jpegtran, you will have to type the command like this.

danie@linux:~$ /opt/mozjpeg/bin/jpegtran --help

Instead of typing such a command, we will create a link for easier use, we name it mozjpeg to make it easier to remember.

danie@linux:~$ sudo ln -s /opt/mozjpeg/bin/jpegtran /usr/local/bin/mozjpeg

Now you just need to type the command like this.

danie@linux:~$ mozjpeg --help

Conclusion

So the article has guided you step by step to successfully install the Mozjpeg tool in Linux Mint 19. I believe these installation steps will also work well on both new Ubuntu and Debian versions.

If you liked this article, then please subscribe to our YouTube Channel for more video tutorials. You can also find us on Twitter and Facebook.


Share this post to your friends !
  • 1
    Share
If you appreciate what we share in this blog, you can support us by:
  1. Stay connected to: Facebook | Twitter | Google Plus | YouTube
  2. Subscribe email to recieve new posts from us: Sign up now.
  3. Start your own blog with SSD VPS - Free Let's Encrypt SSL ($2.5/month).
  4. Become a Supporter - Make a contribution via PayPal.
  5. Support us by purchasing Ribbon Lite Child theme being using on this website.

We are thankful for your support.

single post bottom banner
«« »»

Got something to say? Join the discussion

Please keep in mind that all comments are subject to our Comment Policy. Your email address will not be published.
This site uses Akismet to reduce spam. Learn how your comment data is processed.