1.安装

wget http://pngquant.org/pngquant-2.8.2-src.tar.gz

tar -xzf pngquant-2.8.2-src.tar.gz

cd pngquant-2.8.2

安装依赖:yum install libpng-devel

./configure

make && make install

ok ,安装完成。

pngquant -h 看是否正常,如果报:pngquant: error while loading shared libraries: liblcms2.so.2: cannot open shared object file: No such file or directory

重新装一下liblcms2 , yum install http://pkgrepo.linuxtech.net/el6/release/x86_64/liblcms2-2.4-1.el6.x86_64.rpm 解决

Options

See pngquant -h for full list of options.

--ext new.png

Set custom extension for output filename. By default -or8.png or -fs8.png is used.

--quality min-max

Instructs pngquant to use the least amount of colors required to meet or exceed the max quality. If conversion results in quality below the min quality the image won't be saved (if outputting to stdout, 24-bit original will be output) and pngquant will exit with status code 99.

min and max are numbers in range 0 (worst) to 100 (perfect), similar to JPEG.

pngquant --quality=65-80 image.png
--speed N-sN

Speed/quality trade-off from 1 (brute-force) to 10 (fastest). The default is 3. Speed 10 has 5% lower quality, but is 8 times faster than the default.

--iebug

Workaround for IE6, which only displays fully opaque pixels. pngquant will make almost-opaque pixels fully opaque and will avoid creating new transparent colors.

--version

Print version information to stdout.

-

Read image from stdin and send result to stdout.

--

Stops processing of arguments. This allows use of file names that start with -. If you're using pngquant in a script, it's advisable to put this before file names:

pngquant $OPTIONS -- "$FILE"

使用pngquant命令近乎无损压缩PNG图片大小减少70%左右的更多相关文章

  1. Web 性能优化: 图片优化让网站大小减少 62%

    摘要: 压缩各种格式的图片. 原文:Web 性能优化: 图片优化让网站大小减少 62% 作者:前端小智 Fundebug经授权转载,版权归原作者所有. 这是 Web 性能优化的第二篇,上一篇在下面看点 ...

  2. WebView加载HTML图片大小自适应与文章自动换行

    http://www.brighttj.com/ios/ios-webview-load-html-image-adaptive.html 在很多App中都会使用到webview,尤其是在加载新闻内容 ...

  3. C# 压缩图片到指定宽度,假如图片小于指定宽度 判断图片大小是否大于指定大小(KB) 如果大于则压缩图片质量 宽高不变

    class Program { static void Main(string[] args) {//G:\zhyue\backup\projects\Test\ConsoleApplication1 ...

  4. jupyter notebook改变行间图片大小

    jupyter notebook使用起来代码效果很直接,这是我最喜欢的一点,但是主题单一,后来改了一下主题.也可以接受了,但是还有一个问题是显示图片太小我们可以用两个方法来改变它. 一.可以通过rcP ...

  5. [Word]中批量修改图片大小和缩放比例方法

    最近小编遇到一个问题:需要将一篇厘米.打开.宏名起好了,单击"创建"进入.返回word,工具-宏-宏(或者直接按Alt+F8),再次进入宏的界面,选择刚才编辑好的宏,并单击&quo ...

  6. 图片大小以及dp和px关系一览表,logo尺寸

    图片大小以及dp和px关系一览表 说明:根据上表,我们应该很容易算出一张图片在不同手机上的宽和高是多少. 结论 从上表可以得出如下结论 1. 图片放在drawable中,等同于放在drawable-m ...

  7. 关于Android中图片大小、内存占用与drawable文件夹关系的研究与分析

    原文:关于Android中图片大小.内存占用与drawable文件夹关系的研究与分析 相关: Android drawable微技巧,你所不知道的drawable的那些细节 经常会有朋友问我这个问题: ...

  8. C#.Net 上传图片,限制图片大小,检查类型完整版

    C#.Net 上传图片,限制图片大小,检查类型完整版 源代码: 处理图片类,如检查图片大小,按宽度比例缩小图片 public class CImageLibrary{   public enum Va ...

  9. css限制图片大小,避免页面撑爆

    /*==========限制图片大小======避免页面撑暴========*/img { max-width:100%;width:expression(width>669?"100 ...

随机推荐

  1. Unreal Engine Plugin management

    Be aware to remove any dependencies to any modules related to Editor, or else it will end up with fa ...

  2. 对vector<int>进行快速排序

    #include <iostream>#include <string>#include <vector>using namespace std;void Quic ...

  3. 自定义一个只显示年月的DatePicker(UIDatePicker无法实现年月显示)

    HooDatePicker 介绍(introduction) ==================================================项目需要一个DatePicker,只显 ...

  4. marquee 实现首尾相连循环滚动效果

    <marquee></marquee>可以实现多种滚动效果,无需js控制.使用marquee标签不仅可以滚动文字,也可以滚动图片,表格等  marquee标签不是HTML3.2 ...

  5. 记录Js

    1.对于js,没有系统的学习.有要经常的用到,每次都是百度查找,为了以后能查询. (1). $(function () { $('.restbtn').on("click", fu ...

  6. Intel RealSense SDK 简翻

    :first-child{margin-top:0!important}img.plugin{box-shadow:0 1px 3px rgba(0,0,0,.1);border-radius:3px ...

  7. ionic cordova 热更新(引用自www.zyyapp.com/post/116.html)

    上篇文章cordova 把html打包成安卓应用 http://www.zyyapp.com/post/115.html cordova 热更新是一个大坑,我看了一天一夜才明白.网上的教程都没说到重点 ...

  8. Three.js资源

    学习教程:http://www.hewebgl.com/ 例子:http://threejs.org/

  9. 使用恶意USB设备解锁 Windows & Mac 锁屏状态

    NSA专业物理入侵设备——USB Armory,可解锁任意锁屏状态的下的Windows和Mac操作系统,含最新发布的Windows10.及较早的Mac OSX El Capitan / Maveric ...

  10. vim 分屏显示

    我用vim打开一个文件后,想同时打开另一个文件,就像windows中打开两个记事本一样,因此需要分屏显示 首先用vim打开一个文件 vim file1 输入命令[Esc] :sp file2 分屏打开 ...