How to convert webp to png/jpg/gif in MacOS

本文介绍如何在MacOS上使用Homebrew安装WebP工具,并通过批处理脚本将WebP格式图片转换为PNG格式,以便用作壁纸。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Environment

I'm using OS X 10.11.4 and have homebrew 1.0.5 installed.

Introduction

I recently downloaded several pictures from Google Plus to use them as my wallpaper galaxy. But the images are all in webp format. MacOS doesn't support webp as a valid wallpaper format.

WebP is an image format employing both lossy and lossless compression. WebP supports for animation as an alternative to the popular GIF format, citing the advantages of 24-bit color with transparency, combining frames with lossy and lossless compression in the same animation, and as well as support for seeking to specific frames. It has been reported by Google that it has a 64% reduction in file size for images converted from animated GIFs to lossy WebP, and a 19% reduction when converted to lossless WebP.

Steps

  • Make sure you have [homebrew](http://brew.sh/) installed
# using brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Install webp

To convert from webp, webp support should be available

brew install webp
  • Batch using script

1 the package contains several commands

ls /usr/local/Cellar/webp/0.5.1/bin/
# cwebp   dwebp   webpmux

for i in *.webp; do
    dwebp $i -o ${i//webp/png} $i &>/dev/null
    echo "Done with $i"
done
# using for-loop
# using dwebp of package webp
# Or one-liner
for i in *.webp; do dwebp $i -o ${i//webp/png} $i &>/dev/null; echo "Done with $i"; done

转载于:https://www.cnblogs.com/raybiolee/p/5917533.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值