.webp装换png ios_把 webp 格式转换成 jpeg/png

上一篇迁移post中提到新版的500px.com全部使用webp的图片格式,这个是在浏览器中可以打开的,但是Windows默认不支持的,好像之前iMac也不能识别。尽管webp有很多优势,但是jpeg/png的地位还是撼动不了的。

Windows 上可以装一个插件,使用“Windows Photo Viewer”打开,现在有Ubuntu on Windows了方便了好多,可以直接使用命令行来完成,相当高效。

安装使用webp

下载

解压

这里我选择在Ubuntu on Windows 上使用,所以下载了linux版本

$ wget https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-0.6.0-rc3-linux-x86-64.tar.gz

$ ls -la libwebp-0.6.0-rc3-linux-x86-64.tar.gz

$ tar -zxf $_

$ cd libwebp-0.6.0-rc3-linux-x86-64/

~/libwebp-0.6.0-rc3-linux-x86-64

$ ls

bin doc include lib README README.mux

~/libwebp-0.6.0-rc3-linux-x86-64

$ ls -R

.:

bin doc include lib README README.mux

./bin:

anim_diff cwebp dwebp gif2webp img2webp vwebp webpmux

./doc:

cwebp.html dwebp.html gif2webp.html img2webp.html vwebp.html webpmux.html

cwebp.txt dwebp.txt gif2webp.txt img2webp.txt vwebp.txt webpmux.txt

./include:

webp

./include/webp:

decode.h demux.h encode.h mux.h mux_types.h types.h

./lib:

libwebp.a libwebpdemux.a libwebpmux.a

$ cd ..

$ mv libwebp-0.6.0-rc3-linux-x86-64 .local/libwebp-0.6.0

配置

# add to shell configuration file in your home dir

# bash .bashrc/.bash_profile

# zsh .zshrc

# csh .cshrc

# fish .fishrc等等

PATH=/home/xxx/.loca/libwebp-0.6.0/bin:$PATH

source ~/SHELLCONFIGURATIPNFILE

使用

cwebp encodes images in either JPEG, PNG or TIFF format into WebP;

dwebp decodes images in WebP format into PNG;

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

$ dwebp image.webp -o image.png

此外

# Ubuntu:

sudo apt install webp

Reference

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值