3

After conversion, the new file size is even bigger. ??

Why is that?

andy@7 ~/Downloads> convert Screenshot_1360x768.png -resize 1024x578! smaller.png
andy@7 ~/Downloads> ls

-rw-rw-r-- 1 andy andy 135725 Sep 7 19:45 Screenshot_1360x768.png

-rw-rw-r-- 1 andy andy 154448 Sep 7 20:17 smaller.png

fixit7
  • 3,399

1 Answers1

6

ImageMagik's convert function will sometimes do things like this when there isn't a great deal of room for compression. If you work with a lot of PNGs, then you may be interested in optipng which offer a bit more flexibility when optimising PNG files.

Using the following command, a full-screen capture of this AskUbuntu question has the following result:

-rw-r--r--  1 jason jason 1371805  9月  8 10:35 Screenshot_20220908_103518.png

optipng -o7 Screenshot_20220908_103518.png

-rw-r--r-- 1 jason jason 480525 9月 8 10:37 Screenshot_20220908_103518.png

You can adjust the optimisation level with the -o option, with values between 5 and 7 generally returning the better results. Values of 8 and 9 may result in some pixellation of photos with a wide colour range.

matigo
  • 24,752
  • 7
  • 50
  • 79