Converting pictures in a Docker container using Guetzli

If you want to convert pictures using Guetzli but you don’t want to install all progams and libraries, you can use the following script. The script will execute a Docker container in which Guetzli and all it’s dependencies are installed. All pictures that are handed over while executing the script will be processed and put out after the process has finished.

My contribution was only the script. The Docker image was already available on the Docker Hub.

In the following steps I will give a short description on how to use the script.


To use the script, you first have to download it.

git clone


Method 1:

The first method is to only pass a single picture to the script for execution.

bash /home/user/Bilder/1234.jpg 

This will result in the picture named “1234.jpg” being converted.

Method 1:

To convert several pictures at once, the following method can be used.

bash /home/user/Bilder/*

This will convert all pictures in the directory /home/user/Bilder/.

While the pictures are being processed you can monitor the resource usage using htop.


With both methods, the original files will remain in the directory alongside with the new converted pictures which have the ending _guetzli.

Quality adjustments

To have a relatively small file as result after converting, I have set the quality to 85%. To achieve a higher output quality, the parameter “–quality” in the script has to be changed.

docker run --rm -it -v "$(pwd):/work" -w /work icedream/guetzli \
--quality 85 $file $guetzlifile
Source of preview picture:

By Google Inc. –
Apache License 2.0,

Add a Comment

Your email address will not be published. Required fields are marked *