https://github.com/frops/2webp
A fast, multi-threaded CLI tool for converting JPG/JPEG files to WebP format
https://github.com/frops/2webp
Last synced: 5 months ago
JSON representation
A fast, multi-threaded CLI tool for converting JPG/JPEG files to WebP format
- Host: GitHub
- URL: https://github.com/frops/2webp
- Owner: frops
- License: mit
- Created: 2024-11-18T08:46:45.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-28T08:09:18.000Z (over 1 year ago)
- Last Synced: 2024-11-28T09:22:39.279Z (over 1 year ago)
- Language: Go
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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:**
```bash
docker build -t 2webp .
```
2. **Run the container with your images:**
```bash
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:
```bash
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`:**
```bash
2webp -src ./input -dst ./output
```
2. **Force reconversion of all images:**
```bash
2webp -src ./input -dst ./output -force
```
3. **Use 8 threads for faster processing:**
```bash
2webp -src ./input -dst ./output -threads 8
```
4. **Run via Docker:**
```bash
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!