A simple CLI tool to convert images (currently JPG/JPEG) to WebP format. Fast, multithreaded, and easy to use
You can also run 2webp using Docker, which ensures all dependencies are packaged:
-
Build the Docker image:
docker build -t 2webp . -
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
Run the 2webp command with the following options:
2webp -src /path/to/source -dst /path/to/destination [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.
-
Convert all images from
inputtooutput:2webp -src ./input -dst ./output
-
Force reconversion of all images:
2webp -src ./input -dst ./output -force
-
Use 8 threads for faster processing:
2webp -src ./input -dst ./output -threads 8
-
Run via Docker:
docker run --rm -v /local/source:/input -v /local/destination:/output 2webp -src /input -dst /output -threads 4
docker logindocker tag 2webp frops/2webpdocker push frops/2webp
- Multithreaded: Speed up conversions with the
-threadsoption. - Docker Support: Fully packaged with all dependencies using Docker.
- Skip existing files: Avoid reconversion unless
-forceis specified.
Start converting your images to WebP with a single command!