A blazing-fast, lightweight single static binary to convert images from JPG, PNG formats to Webp
- Lightning Fast - Converts 30
.jpg(Dimensions: 5120 × 2880) images to.webpwithin 10s - Ultra Lightweight - Single ~5MB binary, no external dependencies
- Zero Config - Just run and forget
- Multiple Formats - Supports JPG, JPEG, PNG
- Auto-Cleanup - Automatically deletes original images after conversion
- Cross-Platform - Works on macOS, Linux, and Windows
More aren't planned but feel free to add them yourself.
- Scan - Recursively scans the input directory for supported image formats
- Queue - Creates a work queue with all found images
- Process - Uses a worker pool (up to 8 concurrent workers) to convert images in parallel
- Encode - Uses the high-performance
gen2brain/webplibrary for WebP encoding - Cleanup - Removes original images after successful conversion
- Exit - Automatically exits when all conversions are complete
High-Resolution Batch Conversion:
- Images: 30 JPEG files
- Total Size: 313MB
- Per Image: 10.8MB, 5120 × 2880 pixels (5K resolution)
- Completion Time: 9.34 seconds
- Result: 30 high-resolution images converted to WebP in under 10s
# Clone the repository
git clone <repository-url>
cd imgconverter
# Build the binary
task build
# Or with go directly
go build -o build/imgconverter -ldflags="-s -w" .- Create a
converter/folder in the same directory as the binary - Put your images inside the folder
- Run the binary:
./build/imgconverter- Done! All images are converted to
.webpin the same directory and originals are removed
You can specify a different input directory:
./build/imgconverter /path/to/your/imagesSuccess:
Found 42 image(s) to convert
Conversion completed!
Successful: 42
Time taken: 850ms
With Failures:
Found 50 image(s) to convert
Conversion completed!
Successful: 45
Failure: 5
Failed Images: corrupt1.png, corrupt2.jpg, missing.png, bad.png, error.jpg
Time taken: 1.23s
task buildtask build-allThis creates binaries for:
- macOS (Intel & Apple Silicon)
- Linux (AMD64 & ARM64)
- Windows (AMD64)
The binary looks for a converter/ folder by default. Create it:
mkdir converterOr specify a custom path:
./build/imgconverter /path/to/imagesEnsure your images have supported extensions:
.jpgor.jpeg.png
Make the binary executable:
chmod +x build/imgconverter- This project was entirely created using AI, but the application has been thoroughly tested (only on macOS Sequoia).
- This project was built primarily for my personal use, so I will not be merging pull requests or adding new features unless I need them myself. If you want to make changes or add features, feel free to fork this repository. It’s open-sourced so others can learn from it, use it as a base for their own projects, or even run the application as-is.