some jpgs are badly compressed, taking 5-10MBytes each!

a little nifty cool tool let’s you batch recompress

WARNING! Always test things out before applying it to your original data!

# become root
su - root
# install jpegoptim
apt install jpegoptim
yum install jpegoptim
# Ctrl+D quit root mode
# change into folder that holds the images
cd /home/user/Pictures/jpgs/
# make new folder, to test it out
mkdir temp;
# copy a test-image into temp folder
cp -v /home/user/Pictures/jpgs/10-91_0001.jpg ./temp
cd temp
# test convert
jpegoptim -m 90 *.jpg

m, –max=
Sets the maximum image quality factor (disables lossless optimization mode, which is by default enabled).

This option will reduce quality of those source files that were saved using higher quality setting.

While files that already have lower quality setting will be compressed using the lossless optimization method.

Valid values for quality parameter are: 0 – 100

check if one is happy with the quality after conversion by opening it with one’s favorite picture software and inspecting quality.

for example with: eye of mate

https://packages.debian.org/sid/eom

Eye of MATE graphics viewer program

eom or the Eye of MATE is a simple graphics viewer for the MATE desktop which uses the gdk-pixbuf library. It can deal with large images, and zoom and scroll with constant memory usage. Its goals are simplicity and standards compliance.

eog.i686 : Eye of GNOME image viewer
eog.x86_64 : Eye of GNOME image viewer
eom.x86_64 : Eye of MATE image viewer

if quality is still good enough back to folder that has all the pictures

cd ..
# run it again
jpegoptim -m 90 *.jpg
# should save one a lot of disk space

warning again:

one could probably recompress all jpgs in all subdirectories of the current dir via find:

# compress all jpg in the current directory
# and all subdirectory of the current directory
find . -type f -exec jpegoptim -v -m 90 {} \;

manpages:

jpegoptim.man.txt

liked this article?

  • only together we can create a truly free world
  • plz support dwaves to keep it up & running!
  • (yes the info on the internet is (mostly) free but beer is still not free (still have to work on that))
  • really really hate advertisement
  • contribute: whenever a solution was found, blog about it for others to find!
  • talk about, recommend & link to this blog and articles
  • thanks to all who contribute!
admin