webp的格式的转换

星期五, 2016-12-16 | Author: Lee | html5 | 4,879 views

webp出来的有年头了,最近在看微信分享处理的文章 在 chrome浏览器下图片都是webp的格式,想另存为发现无法直接打开.

想从微信获取 jpg和png格式图片:可以使用 Mozilla Firefox 和IE 打开 都会正常显示 成jpg 和png 格式.

貌似是js检测了是否支持webp 再来加载图片的策略来 节省大规模的流量带宽.

对webp的格式一直想自动转换,去了google官方 提供的对应的转换lib包可以用命令行直接调用,也是蛮方便的.

试验了一个图片,果然压缩率 很厉害 从 31K(webp) –>408K (png),质量基本上无差

本地win-x64下载包:libwebp-0-5-1-windows-x86

640

官方使用说明:https://developers.google.com/speed/webp/docs/using

对应各个平台的下载包地址:https://storage.googleapis.com/downloads.webmproject.org/releases/webp/index.html

简要使用说明:
Using cwebp to Convert Images to the WebP Format

Use cwebp on the command line to convert PNG or JPEG image files to WebP format. You can convert a PNG image file to a WebP image with a quality range of 80 with the command:

cwebp -q 80 image.png -o image.webp

Consult the cwebp documentation for a description of the encoder, its standard and advanced options.

Using dwebp to Convert Images from the WebP Format

Use dwebp on the command line to convert WebP image files to the PNG or PPM format. You can convert a WebP image file, say image.webp to a PNG image with the command:

dwebp image.webp -o image.png

Consult the dwebp documentation for a description of the decoder and its command-line options.

使用截图如下:
webp-change

更多的webp图片格式的说明和比较可以参阅这篇文章:http://www.jianshu.com/p/e3df77df7d67 浅谈 WebP 图片格式

Tags:

文章作者: Lee

本文地址: https://www.pomelolee.com/1647.html

除非注明,Pomelo Lee文章均为原创,转载请以链接形式标明本文地址

No comments yet.

Leave a comment

Search

文章分类

Links

Meta