A simple CLI tool for batch optimizing PNG and JPEG images while preserving quality
- Batch process all PNG and JPEG files in a specified directory
- Compress images with configurable quality levels (default: 85 for JPEG, optimize for PNG)
- Preserve original EXIF metadata and file timestamps
- Display compression statistics: original size, optimized size, and percentage saved
- Create optimized files in output directory (preserving original files)
- Show progress bar for batch operations using rich library
- Support recursive directory processing with --recursive flag
- Dry-run mode to preview compression results without saving files
- Summary report showing total space saved across all processed images
- Skip already optimized files that would increase in size
- Colorized terminal output for better readability
# Clone the repository
git clone https://github.com/KurtWeston/img-optimize.git
cd img-optimize
# Install dependencies
pip install -r requirements.txtpython main.py- python using click
clickPillowrich
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.