Reducing the file size of a very large images, without changing the image dimensions

后端 未结 12 2264
囚心锁ツ
囚心锁ツ 2021-01-31 08:51

Consider an application handling uploading of potentially very large PNG files.

All uploaded files must be stored to disk for later retrieval. However, the PNG files ca

12条回答
  •  耶瑟儿~
    2021-01-31 09:03

    You can try the pngquant utility. It is very simple to install and to use. And it can compress your PNGs a lot without visible quality loss.

    Once you install it try something like this:

    pngquant yourfile.png
    pngquant --quality=0-70 yourfile.png
    

    For my demo image (generated by imagemagick) the first command reduces 350KB to 110KB, and the second one reduces it to 65KB.

提交回复
热议问题