Skip to content

Instantly share code, notes, and snippets.

@aksuited
aksuited / optimize_jpegs.pl
Last active October 25, 2019 10:02
Perl Script to Optimize Jpegs Using JPEGTRAN or (if linked) MOZJPEG
#!/usr/bin/perl
#
# Lossless optimization for all JPEG files in a directory
# First Install & Link MOZJPEG
#Tested on Ubuntu 16.04 using pre-compiled binaries as per below:
#For 64bit:
#wget https://mozjpeg.codelove.de/bin/mozjpeg_3.2_amd64.deb
#dpkg -i mozjpeg_3.2_amd64.deb
#ln -s /opt/mozjpeg/bin/jpegtran /usr/bin/jpegtran