7

How can I compress PNG and JPG images by more than 50%?

Zanna
  • 69,223
  • 56
  • 216
  • 327
Hideki Nishimura
  • 679
  • 6
  • 10
  • 13

1 Answers1

11

There is a handy tool called mogrify that enables to do all sort of batch operations with images.

How to reduce quality of photos:

  1. Put all of them in one directory.
  2. Make a backup of the directory.
  3. Open terminal in the folder (typically by pressing F4).
  4. Run command mogrify -quality 60% * (this will reduce quality of all .jpg, .jpeg, .png images listed in the folder)

Be aware that image files will be replaced by reduced one. Make a backup first just in case you reduced a quality too much.

You can look up more functionality that mogrify provide in man mogrify.

To install mogrify, try sudo apt-get install -y imagemagick.

Enjoy :)

Nam G VU
  • 2,138
  • 4
  • 21
  • 30
Sebastian
  • 1,168
  • 2
  • 14
  • 29
  • 3
    The install command is now, `sudo apt-get install imagemagick` – Kols Jun 06 '20 at 15:45
  • Better compressed result for me is with `optipng` [ref](https://askubuntu.com/a/1440003/22308) – Nam G VU Nov 10 '22 at 08:06
  • For png's [this article](https://medium.com/@duhroach/reducing-png-file-size-8473480d0476) has some discussion of all the various tools. According to the author, the place to start would be `zopfli` (in Ubuntu 20.04 repo). – Diagon Jul 05 '23 at 05:53