Commit a1447383 authored by sajolida's avatar sajolida
Browse files

Use trimage instead of optipng and advancecomp (#17099)

To get 6% more compression on average.

Doing mat2 before trimage leads to slightly bigger files than trimage
only but to better compression than doing trimage before mat2.
parent fe2c7513
......@@ -78,7 +78,7 @@ To use these tools, please first install the dependencies:
- Images on our website are compressed and cleaned using the
[[compress-image.sh]] script. To run this script you need the
`optipng`, `advancecomp`, and `mat` packages.
`trimage` and `mat2` packages.
## QR codes
......
......@@ -3,13 +3,8 @@
set -e
set -u
if [ ! -x /usr/bin/optipng ]; then
echo "Please install the \"optipng\" package." >&2
exit 1
fi
if [ ! -x /usr/bin/advdef ]; then
echo "Please install the \"advancecomp\" package." >&2
if [ ! -x /usr/bin/trimage ]; then
echo "Please install the \"trimage\" package." >&2
exit 1
fi
......@@ -19,8 +14,7 @@ if [ ! -x /usr/bin/mat2 ]; then
fi
for image in "${@}" ; do
optipng -o6 "${image}"
advdef -z3 "${image}"
mat2 "${image}"
trimage -f "${image}"
mv "${image%.*}.cleaned.${image#*.}" "${image}"
done
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment