A lightweight, powerful, and portable image optimization utility for Windows. This project now offers two ways to run, depending on your needs.
- No Installation Required: Works on any Windows PC.
- Single File: Everything is contained in
ImageOptimizer.ps1. - Easy Launch: Just double-click
Image Optimizer.bat. - Features: Interactive arrow-key UI, auto-dependency downloading, safety backups.
- Superior UI: Uses the
richlibrary for high-fidelity terminal panels and tables. - Robust Engines: Better process handling and error management via Python.
- Requirements: Requires Python 3.8+ and
pip install -r requirements.txt. - Usage: Run
python image_optimizer.py.
- Magick-First Strategy: Uses ImageMagick (preferred) or FFmpeg for professional-grade results.
- Guided Onboarding: If you don't have the tools, the scripts offer to download temporary portable versions automatically.
- Multi-Format Support: WebP, AVIF, JPG, PNG, and more.
- Intelligent Logic:
- Original Size Protection: Never keeps a file if the optimized version is larger.
- EXIF Stripping: Cleans metadata to save extra space.
- Output Modes: Save as copy, Overwrite, or Backup to
.Originals.
To unlock the full potential of Image Optimizer, you can provide portable binaries:
- Place
magick.exeinTools/ImageMagick/ - Place
ffmpeg.exeinTools/FFmpeg/
Alternatively, if these tools are already installed on your system and available in your PATH, Image Optimizer will detect and use them automatically.
Open PowerShell in your target folder and launch the script directly from the web:
irm https://raw.githubusercontent.com/BishnuMahali/Image-Optimizer/main/ImageOptimizer.ps1 | iexInteractive Mode Run the downloaded script without arguments to launch the interactive UI:
.\ImageOptimizer.ps1Non-Interactive CLI Mode
# Optimize a single image using the "Web Optimized" preset
.\ImageOptimizer.ps1 -Path "C:\Images\photo.jpg" -Preset "WebOptimized"
# Batch optimize a folder recursively, converting to WebP
.\ImageOptimizer.ps1 -Path "C:\Images" -Recursive -Format WebP -Quality 80
# Dry-run a directory to see potential space savings
.\ImageOptimizer.ps1 -Path "C:\Images" -DryRun- Script execution disabled: Run
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserto allow PowerShell scripts to run on your system. - Engine not detected: Ensure
magick.exeorffmpeg.exeare placed correctly in theTools/directories or are accessible via systemPATH.
This project is licensed under the MIT License. See the LICENSE file for details.
This project supports integration with ImageMagick and FFmpeg. These are independent open-source projects with their own licenses. Please review THIRD_PARTY_NOTICES.md for full attribution and legal details.
Contributions are welcome! Whether it's adding new presets, improving engine abstractions, or reporting bugs, please feel free to open an issue or submit a pull request.
These projects are simple utility scripts built to solve everyday problems. If you find them helpful in your workflow and would like to support me, any small contribution is deeply appreciated! ❤️