A professional, fast, and reliable command-line tool for converting images between different formats.
- 🚀 Fast & Efficient - Built with Rust for maximum performance
- 🎨 Multiple Formats - Supports PNG, JPEG, GIF, BMP, ICO, TIFF, WebP, AVIF, and more
- 📋 Clipboard Support - Paste images directly from clipboard (IrfanView, GIMP, browsers, etc.)
- 🔧 Flexible CLI - Multiple input methods (flags or positional arguments)
- 📦 Smart Detection - Automatically detects output format from file extension
- 🎯 Quality Control - Adjustable quality settings for lossy formats
- 🌈 Colored Output - Beautiful, informative terminal output
- ⚡ Zero Configuration - Works out of the box
cargo install imgconvgit clone https://github.com/cumulus13/imgconv
cd imgconv
cargo install --path .git clone https://github.com/cumulus13/imgconv
cd imgconv
cargo build --release
# Binary will be at ./target/release/imgconvThe simplest way to convert an image:
imgconv input.webp output.pngimgconv -i photo.jpg -o photo.webpSpecify quality for lossy formats (1-100, default: 90):
imgconv input.png output.jpg -q 85Paste from clipboard (works with IrfanView, GIMP, Photoshop, browsers, etc.):
# Auto-detect format from clipboard
imgconv -c output_image
# Output: output_image.png (or detected format)
# Specify output extension (auto-corrects if mismatch)
imgconv -c output_image.png
# If clipboard is JPG → auto-corrects to output_image.jpg
# Force conversion to specific format
imgconv -c output_image -e jpg
# Clipboard PNG → converts to output_image.jpg
imgconv -c output_image.png -e webp
# Any clipboard format → converts to output_image.webpClipboard behavior:
- Without
-e: Auto-detects format and corrects extension if needed - With
-e: Forces conversion to specified format - Smart extension correction prevents format mismatches
When output filename doesn't have an extension:
imgconv input.jpg output -f pngThis will create output.png
All these commands are valid:
# Positional arguments
imgconv image.bmp image.png
# With input flag only
imgconv -i photo.webp output.jpg
# With output flag only
imgconv input.png -o result.jpg -q 95
# All flags
imgconv -i input.avif -o output.png -f png -q 100| Format | Extension(s) | Read | Write |
|---|---|---|---|
| PNG | .png |
✅ | ✅ |
| JPEG | .jpg, .jpeg |
✅ | ✅ |
| GIF | .gif |
✅ | ✅ |
| BMP | .bmp |
✅ | ✅ |
| ICO | .ico |
✅ | ✅ |
| TIFF | .tiff, .tif |
✅ | ✅ |
| WebP | .webp |
✅ | ✅ |
| AVIF | .avif |
✅ | ✅ |
| PNM | .pnm, .pbm, .pgm, .ppm |
✅ | ✅ |
| TGA | .tga |
✅ | ✅ |
| DDS | .dds |
✅ | ✅ |
| HDR | .hdr |
✅ | ✅ |
| Farbfeld | .ff |
✅ | ✅ |
imgconv photo.webp photo.pngCopy image in any image viewer (IrfanView, GIMP, browser), then:
# Save as detected format
imgconv -c my_image
# Save as PNG
imgconv -c screenshot.png
# Convert clipboard to JPEG
imgconv -c photo -e jpg -q 85Convert all WebP files to PNG in the current directory:
Linux/macOS:
for f in *.webp; do imgconv "$f" "${f%.webp}.png"; doneWindows PowerShell:
Get-ChildItem *.webp | ForEach-Object { imgconv $_.Name ($_.BaseName + ".png") }Windows CMD:
for %f in (*.webp) do imgconv "%f" "%~nf.png"Reduce JPEG file size with lower quality:
imgconv large.jpg compressed.jpg -q 75Modern format with great compression:
imgconv photo.png photo.webp -q 80Combine with other tools like ImageMagick:
# Resize then convert
convert input.jpg -resize 200x200 temp.jpg && imgconv temp.jpg thumbnail.webp -q 85Usage: imgconv [OPTIONS] [INPUT] [OUTPUT]
Arguments:
[INPUT] Positional input file (alternative to -i)
[OUTPUT] Positional output file (alternative to -o)
Options:
-i, --input <FILE> Input image file (conflicts with -c)
-o, --output <FILE> Output image file or directory
-c, --clipboard Paste image from clipboard
-f, --format <FORMAT> Output format (auto-detected from extension if not specified)
[possible values: png, jpeg, jpg, gif, bmp, ico, tiff, tif,
webp, avif, pnm, tga, dds, hdr, farbfeld]
-e, --extension <EXT> Extension for output file (use with -c for conversion)
-q, --quality <NUM> Quality for lossy formats like JPEG (1-100) [default: 90]
-V, --version Print version information
-h, --help Print help
imgconv is built with Rust and optimized for performance:
- Fast Decoding: Efficient image parsing
- Optimized Encoding: Smart compression algorithms
- Low Memory: Minimal memory footprint
- Release Build: LTO and optimizations enabled
imgconv provides clear, helpful error messages:
$ imgconv missing.jpg output.png
Error: Input file not found: missing.jpg
$ imgconv input.jpg output.xyz
Error: Could not determine output format from 'output.xyz'.
Please specify --format or use a recognized extensionContributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under either of:
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
at your option.
- Built with the excellent image crate
- CLI powered by clap
- Thanks to the Rust community for amazing tools and libraries
Made with ❤️ using Rust