/2webp

⚡️ A fast, multi-threaded CLI tool for converting JPG/JPEG files to WebP format

Primary LanguageGoMIT LicenseMIT

2webp

A simple CLI tool to convert images (currently JPG/JPEG) to WebP format. Fast, multithreaded, and easy to use

Run with Docker

You can also run 2webp using Docker, which ensures all dependencies are packaged:

  1. Build the Docker image:

    docker build -t 2webp .
  2. Run the container with your images:

    docker run --rm -v /path/to/source:/input -v /path/to/destination:/output frops/2webp -src /input -dst /output

Usage

Run the 2webp command with the following options:

2webp -src /path/to/source -dst /path/to/destination [options]

Options

  • -src: Source directory containing images (required).
  • -dst: Destination directory for WebP files (required).
  • -threads: Number of concurrent workers (default: 4).
  • -force: Reconvert files even if they already exist.

Examples

  1. Convert all images from input to output:

    2webp -src ./input -dst ./output
  2. Force reconversion of all images:

    2webp -src ./input -dst ./output -force
  3. Use 8 threads for faster processing:

    2webp -src ./input -dst ./output -threads 8
  4. Run via Docker:

    docker run --rm -v /local/source:/input -v /local/destination:/output 2webp -src /input -dst /output -threads 4

Push to Docker Hub

  1. docker login
  2. docker tag 2webp frops/2webp
  3. docker push frops/2webp

Features

  • Multithreaded: Speed up conversions with the -threads option.
  • Docker Support: Fully packaged with all dependencies using Docker.
  • Skip existing files: Avoid reconversion unless -force is specified.

Start converting your images to WebP with a single command!