GithubHelp home page GithubHelp logo

towebp's Introduction

ToWebp

This is a simple Bash script that converts all non-WebP images (JPG, JPEG, and PNG) in the current directory to WebP format. The script takes a single argument, which specifies the quality level for the WebP conversion.

Warning: This script will remove the original image files after converting them to WebP format. Ensure you have backups before running this script.

note: You need to have cwebp installed.

usage:

The script is based on the cwebp command-line tool, which is part of the WebP image converter utilities. The main difference between this script and directly using cwebp is that this script automates the conversion process for all compatible images in the current directory. With cwebp, you would need to convert each image individually.

To use the script, simply run:

towebp 90 #90 is the quality level

This command will convert all JPG, JPEG, and PNG images in the current directory to WebP format with a quality level of 90.

installation process:

First, clone this repo or just copy the script on it to .sh file type, or you can follow this steps:

  1. Clone this repository:
git clone https://github.com/averrois/ToWebp.git
  1. Navigate to the repository directory:
cd ToWebp
  1. Make the script executable:
chmod +x /towebp.sh
  1. (Optional) Move or copy the script to a directory in your system's PATH for easy access from any location:
sudo mv towebp.sh /usr/local/bin/towebp

Now, you can run the script from any directory by typing towebp <quality>.

Note: This script requires the cwebp command-line tool to be installed on your system. If you don't have it installed, you may need to install the appropriate package for your distribution (e.g., webp on Ubuntu/Debian or libwebp-tools on CentOS/RHEL).

towebp's People

Contributors

averrois avatar thaikolja 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.