Skip to content

Instantly share code, notes, and snippets.

@adrianorsouza
Created June 7, 2020 22:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adrianorsouza/a274b6bcee45da0c6186a37d5290006c to your computer and use it in GitHub Desktop.
Save adrianorsouza/a274b6bcee45da0c6186a37d5290006c to your computer and use it in GitHub Desktop.
BUILDING MOZJPEG ON LINUX

BUILDING MOZJPEG ON LINUX

Link: https://calendar.perfplanet.com/2014/mozjpeg-3-0/

cd /usr/local/src

sudo curl -LO https://github.com/mozilla/mozjpeg/releases/download/v3.1/mozjpeg-3.1-release-source.tar.gz
sudo tar -xzvf mozjpeg-3.1-release-source.tar.gz
cd mozjpeg

sudo apt-get install nasm

Compile and install

sudo ./configure --prefix=/usr/local/mozjpeg
sudo make
sudo make install

echo 'export PATH=/usr/local/mozjpeg/bin:$PATH' >> ~/.bashrc

source ~/.bashrc

mozjpeg usage

cjpeg -quality 70 -outfile compressed-image.jpg image.jpg

Tested options

cjpeg -verbose -quant-table 2 -quality 75 -outfile image-test.small.jpg image-test.jpg


cjpeg -quant-table 2 -quality 75 -outfile image-test.small.jpg image-test.jpg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment