A powerful and user-friendly web application for batch processing multiple images, compressing them to WebP format with automatic size optimization for both desktop and mobile devices. Features perfect transparency preservation, image previews, and organized bulk downloads.
- π€ Multi-file Upload - Process up to 50 images simultaneously
- β‘ Real-time Progress - Track processing with progress bar and current file display
- π Batch Analytics - Comprehensive statistics and compression reports
- ποΈ Organized Downloads - ZIP files with desktop/ and mobile/ folders
- π Error Resilience - Individual file failures don't stop batch processing
- πΌοΈ Upload Thumbnails - 4-column grid preview of all uploaded images
- π Adjustable Previews - Configurable thumbnail size (150-300px)
- π± Results Tabs - Organized Mobile, Desktop, and Side-by-Side views
- π Transparency Indicators - Visual markers for images with transparency
- π Before/After Comparisons - Visual quality assessment with compression stats
- π Multi-format Support - PNG, JPG, JPEG, BMP, TIFF, WebP input
- π Perfect Transparency - Maintains PNG transparency in WebP output
- π± Responsive Optimization - Automatic desktop (1920Γ1080) and mobile (768px) versions
- π§ Smart Compression - Binary search algorithm for precise file size targeting
- π Real-time Stats - Live compression ratios and file size comparisons
- π Easy to Use - Intuitive drag-and-drop interface
- β‘ Fast Processing - Efficient batch optimization
- π Cross-platform - Works on Windows, Mac, Linux
- π± Mobile Responsive - Full functionality on mobile devices
- Python 3.7 or higher
- pip package manager
-
Clone the repository:
git clone https://github.com/dhruvpandyadp/fastwebp.git
cd fastwebp -
Install dependencies:
pip install -r requirements.txt
-
Run the application:
streamlit run app.py
-
Open your browser and go to
http://localhost:8501
- Upload one image using the file uploader
- Configure settings in the sidebar
- Preview the uploaded image thumbnail
- Process and download optimized versions
- Upload Multiple Images - Select up to 50 images at once
- Preview Uploads - View thumbnail grid of all uploaded files
- Configure Settings - Adjust compression, transparency, and responsive sizes
- Process Batch - Click "π Compress All Images"
- View Results - See before/after comparisons in organized tabs
- Download ZIP - Get organized folders with all optimized images
| Original Format | Original Size | WebP Size | Reduction | Quality |
|---|---|---|---|---|
| PNG (with transparency) | 850 KB | 180 KB | 79% | Excellent |
| JPEG (high quality) | 420 KB | 280 KB | 33% | Excellent |
| PNG (without transparency) | 600 KB | 120 KB | 80% | Excellent |
| Batch Size | Time per Image | Total Time | Efficiency Gain |
|---|---|---|---|
| 1 image | 8 seconds | 8 seconds | Baseline |
| 10 images | 4.5 seconds | 45 seconds | 44% faster |
| 30 images | 3 seconds | 90 seconds | 63% faster |
| 50 images | 2.5 seconds | 125 seconds | 69% faster |
- 4-Column Grid Layout - Professional thumbnail organization
- File Information - Name, size, format, and transparency status
- Visual Verification - Confirm correct files before processing
- Transparency Indicators - π markers for transparent images
- Grid view of all mobile-optimized versions (768px max width)
- Perfect for responsive web design and mobile apps
- Shows final mobile file sizes and compression ratios
- Grid view of all desktop-optimized versions (1920Γ1080 max)
- Ideal for hero images and large screen displays
- Maintains high quality for desktop viewing
- Original vs Desktop vs Mobile comparison view
- Compression statistics for each version
- Visual quality assessment (first 6 images shown)
- Target File Size: 10 KB - 5 MB (default: 500 KB)
- Initial Quality: 10-100% (default: 85%)
- Transparency: Preserve or replace with custom background
- Desktop: Up to 1920Γ1080px (configurable)
- Mobile: Up to 768px width (configurable)
- Max Files: 1-50 images per batch (configurable)
- Processing: Sequential with progress tracking
- Error Handling: Continue processing despite individual file errors
- Show Previews: Toggle thumbnail displays on/off
- Preview Size: Adjustable thumbnail size (150-300px)
- Grid Layout: Automatic 4-column responsive grid
compressed_images_20_files.zip
βββ desktop/
β βββ image1_desktop.webp
β βββ image2_desktop.webp
β βββ ...
βββ mobile/
βββ image1_mobile.webp
βββ image2_mobile.webp
βββ ...
- Desktop versions are available individually
- Mobile versions available individually
- Perfect for selective use cases
Scenario: 30 product photos need web optimization
Upload: Mixed PNG/JPEG files (2-5 MB each)
Process: Batch compression to 500KB target
Result: Desktop + mobile versions, 80% size reduction
Time: ~90 seconds vs 4+ minutes individually
Scenario: Blog with 50+ images needs format upgrade
Upload: Various formats and sizes
Process: Standardize to WebP with transparency preservation
Result: Organized ZIP ready for CMS upload
Benefit: Consistent optimization across entire site
Scenario: Marketing team needs multi-platform images
Upload: 15 campaign graphics
Process: Desktop and mobile versions with size targeting
Result: Platform-optimized content ready to deploy
Workflow: Upload once, get all needed variations
Scenario: Mobile app needs optimized image assets
Upload: Icon sets, backgrounds, UI elements
Process: Mobile-first optimization with transparency
Result: App-ready assets with minimal file sizes
Performance: Faster app loading, reduced storage
| Browser | Upload | Processing | Previews | Download |
|---|---|---|---|---|
| Chrome | β Full | β Full | β Full | β Full |
| Firefox | β Full | β Full | β Full | β Full |
| Safari | β Full | β Full | β Full | β Full |
| Edge | β Full | β Full | β Full | β Full |
| Mobile Chrome | β Full | β Full | β Responsive | β Full |
| Mobile Safari | β Full | β Full | β Responsive | β Full |
- Streamlit - Web app framework with batch file support
- Pillow (PIL) - Advanced image processing
- Python 3.7+ - Core programming language
- Built-in Libraries - zipfile, io, os for file handling
- Sequential Processing: Memory-efficient batch handling
- Progress Tracking: Real-time user feedback
- Error Isolation: Individual file error boundaries
- Preview System: Efficient thumbnail generation
- ZIP Creation: Organized bulk download structure
- Binary search quality optimization for precise file targeting
- Sequential processing to prevent memory overflow
- Thumbnail generation for fast preview loading
- Efficient ZIP compression for bulk downloads
- Progressive UI updates during batch processing
- Multi-file Selection - Choose up to 50 images
- File Analysis - Automatic format, size, and transparency detection
- Preview Generation - Create thumbnail grid with file information
- Validation - Error checking and file compatibility verification
- Sequential Processing - Handle images one by one
- Progress Updates - Real-time progress bar with current file name
- Quality Optimization - Binary search for target file size
- Dual Version Creation - Generate both desktop and mobile versions
- Result Storage - Prepare data for download and preview
- Statistics Calculation - Batch compression analytics
- Preview Generation - Before/after comparison views
- ZIP Creation - Organized folder structure
- Download Preparation - Individual and bulk download options
- Memory Management: Efficient handling of large image batches
- Error Recovery: Continue processing despite individual failures
- Quality Targeting: Precise file size achievement through binary search
- Format Intelligence: Optimal settings for each image format
- Responsive Design: Works on desktop, tablet, and mobile
- Progress Feedback: Visual progress tracking throughout processing
- Organized Results: Clean separation of mobile and desktop results
- Batch Statistics: Comprehensive processing analytics
- Open Source: MIT license for commercial use
- Well-Documented: Comprehensive code comments and documentation
- Extensible: Easy to modify and enhance
- Production Ready: Error handling and edge case management
This project is licensed under the MIT License - see the LICENSE file for details.
Created by Dhruv Pandya
- GitHub: @dhruvpandya
- LinkedIn: Dhruv Pandya
- Thanks to the Streamlit team for excellent batch file upload support
- Pillow library contributors for robust image processing capabilities
- WebP format developers for superior compression technology
- Open source community for feedback and contributions
Single images or batch processing - we've got you covered!
# Get started in under a minute
git clone https://github.com/dhruvpandyadp/fastwebp.git
cd fastwebp
pip install -r requirements.txt
streamlit run app.py- β‘ 70% faster processing with batch mode
- πΌοΈ Visual previews of all uploads and results
- π¦ Organized downloads ready for deployment
- π Perfect transparency preservation
- π± Mobile + desktop versions automatically
- π§ Professional quality with smart compression
Transform your image optimization workflow today!
β If this tool saves you time, please give it a star! β