2.1.1 • Published 11 months ago

@caed0/webp-conv v2.1.1

Weekly downloads
-
License
MIT
Repository
-
Last release
11 months ago

webp-conv - WebP to GIF/PNG Converter

NPM Downloads

webp-conv is a Node.js module for converting both animated and static WebP files to GIF or PNG format. This tool leverages the powerful libwebp library to provide high-quality conversions. With this tool, you can easily convert your WebP images, making it a convenient solution for your image conversion needs.

Installation

You can install webp-conv using npm:

npm install @caed0/webp-conv

Usage

Here's a simple example of how to use webp-conv in your Node.js project:

const webpconv = require('@caed0/webp-conv');
const converter = new webpconv();

const input = 'input.webp';
const output = 'output.gif';

converter.convert(input, output, { quality: 10, transparent: '0x000000' });

This code snippet demonstrates how to convert a list of input WebP files to GIF or PNG format, specifying output quality and transparency settings. The converted files will be saved in the specified output folder.

Parameters

The convert method takes the following parameters:

  • input: The path to the input WebP file you want to convert.
  • output: The path where the converted file will be saved.
  • options (optional): An object containing additional options for the conversion (only apply if the output is an gif).
    • quality: The quality of the output image (0-100). Higher values result in better quality, but larger file sizes. (Default: 10)
    • transparent: A string specifying the transparency color in hexadecimal format (e.g., '0xRRGGBB' or '0xRRGGBBAA'). This option is only applicable to conversions with transperent background. (Default: 0x000000)

Dependencies

This module relies on the libwebp library for WebP image processing. Precompiled binaries of libwebp are automatically downloaded during installation.

License

This project is licensed under the MIT License - see the LICENSE file for details.

The libwebp library is licensed under a separate license. For more information, please refer to the libwebp license.

Issues and Contributions

If you encounter any issues or have suggestions for improvements, please feel free to create an issue on the GitHub repository. Contributions in the form of pull requests are also welcome.

2.0.3

1 year ago

1.1.1

1 year ago

2.1.1

11 months ago

2.0.2

1 year ago

2.1.0

11 months ago

2.0.1

1 year ago

2.0.0

1 year ago

1.1.0

2 years ago

1.0.0

2 years ago