当前位置:编程学习 > C/C++ >>

常见图片格式转换成webp代码和方法

webp与png、jpg相互转换,Convert WEBP to JPG,Convert PNG to webp

主要使用webp-tools

#ubuntu
apt-get install webp
#centos
yum -y install libwebp-devel libwebp-tools
会生成几个工具。

cwebp → WebP encoder tool
dwebp → WebP decoder tool
vwebp → WebP file viewer
webpmux → WebP muxing tool
gif2webp → Tool for converting GIF images to WebP

# convert from webp to png
dwebp mycat.jpg -o mycat.png
# Convert from JPG to WebP
cwebp some.jpg -o target.webp
dwebp可以将webp图片转换成无损的png图片格式,有了png,则可以使用imagemagic之类的工具再转换成jpg.

cwebp可以将jpg转换成webp,将png转换成webp

在线图片格式转换gif转换webp http://pic.zhaoxi.net/

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,