Optimize images for the web in seconds
Features • Installation • Usage • Finder Integration • Configuration
- WebP Conversion - Automatically converts images to WebP format for optimal web performance
- Smart Resizing - Limits maximum dimensions to 1280x1280 while maintaining aspect ratio
- Size Optimization - Targets files under 200KB with intelligent quality and size adjustment
- Quality Preservation - Uses binary search and progressive resizing for optimal compression
- Batch Processing - Process entire folders with a single command
- macOS Native - Finder Quick Actions and Droplet app included
- Fast & Simple - One command, no configuration needed
brew tap jschof1/quick-compress
brew install quick-compresscurl -fsSL https://raw.githubusercontent.com/jschof1/quick-compress/main/install.sh | bash# Clone the repository
git clone https://github.com/jschof1/quick-compress.git
# Run the install script
cd quick-compress
./install.sh- macOS or Linux
- ImageMagick (installed automatically by the install script)
compress path/to/image.jpgOutput: Creates path/to/image.webp (235KB from 2.5MB original)
compress path/to/folderOutput: Converts all images in the folder to optimized WebP files
- JPG / JPEG
- PNG
- GIF
- BMP
- TIFF
All formats are converted to WebP for maximum compression and web compatibility.
- Right-click any image or folder in Finder
- Go to Services → Compress Images for Web
- Get instant optimization!
- Find "Compress Images" app in your Applications folder
- Drag any image or folder onto the app icon
- Or double-click to use the file picker
- Open Finder
- Hold ⌘ Command and drag "Compress Images" app to the toolbar
- Select files and click the button anytime!
| Setting | Value | Description |
|---|---|---|
| Max Width | 1280px | Maximum image width |
| Max Height | 1280px | Maximum image height |
| Max File Size | 200KB | Target file size limit |
| Initial Quality | 80% | Starting WebP quality |
| Min Quality | 25% | Lowest quality before resizing |
Edit the script to customize settings:
# Open the script for editing
nano $(which compress)Modify these variables at the top:
MAX_WIDTH=2560 # Change max width
MAX_HEIGHT=2560 # Change max height
MAX_SIZE=1048576 # Change to 1MB (in bytes)
QUALITY=90 # Change initial quality- Analyze - Checks image dimensions and current file size
- Resize - Scales down images exceeding max dimensions
- Convert - Converts to WebP at 80% quality
- Optimize - If file > 200KB, uses binary search to find the best quality under the limit
- Resize Further - If quality alone is not enough, progressively reduces dimensions
- Save - Outputs optimized WebP in the same location
| Original | Compressed | Savings |
|---|---|---|
| 2.5 MB PNG | 235 KB WebP | 90.6% |
| 4.1 MB JPG | 198 KB WebP | 95.2% |
| 8.7 MB TIFF | 200 KB WebP | 97.7% |
# Optimize website assets
compress ~/MyWebsite/images/
# Prepare photos for blog
compress ~/Desktop/vacation-photos/
# Optimize logo
compress ~/Downloads/logo.pngMake sure your shell configuration was reloaded:
source ~/.zshrc # or ~/.bashrcOr use the full path:
~/.local/bin/compress image.jpgInstall ImageMagick:
# macOS
brew install imagemagick
# Ubuntu/Debian
sudo apt-get install imagemagick
# Fedora
sudo dnf install imagemagickMake sure the script is executable:
chmod +x ~/.local/bin/compressContributions 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
Distributed under the MIT License. See LICENSE for more information.
- ImageMagick for the powerful image processing
- Inspired by the need for simple, fast web optimization
Made with ❤️ for the web development community