创建较小尺寸的 png 文件

fix*_*it7 3 convert-command ubuntu-mate

转换后,新文件的大小更大。??

这是为什么?

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
Run Code Online (Sandbox Code Playgroud)

mat*_*igo 6

convert当没有足够的压缩空间时,ImageMagik 的函数有时会执行类似的操作。如果您使用大量 PNG,那么您可能会对optipng优化 PNG 文件时提供更多灵活性感兴趣。

\n

使用以下命令,全屏捕获此 AskUbuntu 问题将得到以下结果:

\n
-rw-r--r--  1 jason jason 1371805  9\xe6\x9c\x88  8 10:35 Screenshot_20220908_103518.png\n\noptipng -o7 Screenshot_20220908_103518.png\n\n-rw-r--r--  1 jason jason  480525  9\xe6\x9c\x88  8 10:37 Screenshot_20220908_103518.png\n
Run Code Online (Sandbox Code Playgroud)\n

您可以使用该选项调整优化级别-o,5 到 7 之间的值通常会返回更好的结果。值 8 和 9 可能会导致颜色范围较广的照片出现一些像素化。

\n