GithubHelp home page GithubHelp logo

suntyu / webp-converter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jacksgong/webp-converter

1.0 0.0 0.0 524 KB

Converter PNG/JPG to Webp and scan all changes

License: Apache License 2.0

Shell 0.37% Python 99.63%

webp-converter's Introduction

Webp Converter and Analytics

An powerful webp batch converter and differ analytics tool.

You can use this tool to converter batch images(png/jpg) to webp and output size changes.

Purpose

  1. Convert batch images from PNG/JPG format to Webp format
  2. WILL NOT convert images if its webp one is larger than origin one automatically(the origin one will be copied to [output-directory]/origin/ directory)
  3. WILL NOT convert images if it is failed to convert to webp one automatically(the origin image of failed one will be copied to [output-directory]/failed directory)
  4. You can ignore all images which has transparency pixel if you want with --ignore-transparency-image config(the origin image of has-transparency-image will be copied to /webp-converted/transparency directory)
  5. Output convert result, like how much size reduces, how many files skip convert, etc...
  6. You can replace the images with converted-webp image automatically if you want with replace: true config

Install

brew install webp
pip install webp-converter

Use

Example

If you just want to convert all images on the current files when it can be smaller after converted and replace the origin one:

webpc --r

If you just want to convert all images on the current folder and with quality-ratio to 70 and output to ~/Downloads/test-converted when it can be smaller after converted:

webpc -q=70 -o=~/Downloads/test-converted/

If you just want to convert all images on the current folder and with clean the webp-converted folder if it exist and with quality-ratio to 95 and output to ./webp-converted and ignore images when it has transparency on it when it can be smaller after converted:

webpc --c --ignore-transparency-image -q=95

If you want to convert all images on ~/Downloads/img/test folder and output converted result to ~/Downloads/test-converted folder and only converted origin images when it isn't has same name .webp file on ~/Downloads/test-converted folder(just not with --c argument) when it can be smaller after converted:

webpc -o=~/Downloads/test-converted/ ~/Downloads/img/test

My Terminal Config

If you want to adapter the same theme like screenshot above, it's very easy:

  • Firstly, please use powerlevel9k theme(Install the Powerlevel9k Theme and Powerline Fonts as the powerlevel9k repo readme doc said).
  • Secondly, please config the iTerm2-Neutron color scheme.
  • Thirdly, please config your shell(If you are using zsh, just add following code to the ~/.zshrc file):
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir vcs)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status time)
POWERLEVEL9K_TIME_FORMAT="%D{%H:%M:%S}"
POWERLEVEL9K_NODE_VERSION_BACKGROUND='022'
POWERLEVEL9K_SHORTEN_DIR_LENGTH=2

License

Copyright 2017, JacksGong(https://jacksgong.com)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
  http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

webp-converter's People

Contributors

jacksgong avatar

Stargazers

孙田雨 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.