GithubHelp home page GithubHelp logo

images-converter's Introduction

PNG to WebP Converter Script

This script is a Node.js script that converts all PNG files in a folder and its subfolders to the WebP image format. It uses the child_process.execSync() method to execute command-line commands for the conversion process.

Prerequisites

To Download Precompiled WebP utilities and library use the link below:

Installation

  1. Clone the repository or download the script
  2. Install the dependencies by running npm install
  3. Set the source and target folder path in the script.

Usage

node index.js

Configuration

You can configure the script by setting the source and target folder path in the script.

const sourceFolder = path.join(**dirname, "images");

const targetFolder = path.join(**dirname, "images");

Tips

  • You can modify the script to change the quality of the output WebP images by changing the -q value in the cwebp command.
  • You can use the script to convert all PNG images in a specific folder and its subfolders.
  • The script will also convert the PNG files to sRGB color space before converting them to WebP, you can modify the command if you want to use other color space.

Support

If you have any issues or questions, please open an issue or contact me.

Contribution

Feel free to submit pull requests and improve the script.

License

This script is available under the MIT license. See the LICENSE file for more information.

Enjoy!

images-converter's People

Contributors

gasipari avatar

Watchers

 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.