php webp格式转换,webp的格式的转换

星期五, 2016-12-16 | Author:

Leewater.jpgAuthor: Lee

Name: lee

Email: service@i5a6.com

Site: https://www.pomelolee.com/About: webgame网页,手机游戏服务端架构和开发者

| html5 |

3,115 views

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

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

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

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

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

8587ea0c05839e341d582b0be8a0c8ff.png

简要使用说明:

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.

使用截图如下:

1061f8ad6dc91816ee7b464e7b1a19b0.png

~谢谢打赏~

Tags: webp

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值