zoukankan      html  css  js  c++  java
  • How to convert webp to png/jpg/gif in MacOS

    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
    
  • 相关阅读:
    数独游戏 C++ 回溯法
    DirectX 90 3D 网格一
    DirectX 90 3D SetRenderState 设置渲染状态
    DirectX90 3D 字体
    DirectX 90 3D 外接体
    VS2005下配置OGRE
    DirectX 90 3D 网格二
    Java反射机制
    UBUNTU下安装 APACHE+PHP+MYSQL文本服务器!
    关于那个SMTP类及一个例子
  • 原文地址:https://www.cnblogs.com/raybiolee/p/5917533.html
Copyright © 2011-2022 走看看