Image Optimizer Pro
Production-ready VS Code extension for image optimization and asset management
Features •
Installation •
Usage •
Configuration •
Commands
Features
Core Features
- Folder Selection - Select folders and recursively scan for images (PNG, JPG, JPEG, WebP, AVIF, SVG, GIF)
- Image Conversion - Convert images to modern formats (WebP, AVIF, JPG, PNG)
- Smart Compression - Multiple compression modes with configurable quality
- Safe Cleanup - Remove original files with backup and undo support
- Detailed Reports - Generate reports in JSON or Markdown format
🚀 Advanced Features
- Smart Optimization - Automatically choose the best format for each image
- Responsive Images - Generate multiple sizes with HTML
<picture> snippets
- Watch Mode - Automatically process new images in watched folders
- Doctor Mode - Scan for large, unused, or non-modern format images
- Project Presets - Pre-configured settings for Nuxt, Vue, React, Laravel, and static sites
📦 Installation
From VS Code Marketplace
- Open VS Code
- Press
Ctrl+Shift+X (Windows/Linux) or Cmd+Shift+X (Mac)
- Search for "Image Optimizer Pro"
- Click Install
From VSIX File
- Download the
.vsix file from Releases
- Open VS Code
- Press
Ctrl+Shift+P and run "Extensions: Install from VSIX..."
- Select the downloaded file
Usage
Quick Start
- Open the Image Optimizer sidebar (click the icon in the Activity Bar)
- Click Select Folder to choose a folder with images
- View the scan summary showing total images, sizes, and formats
- Choose an action:
- Compress Images - Reduce file sizes
- Convert Format - Change to WebP/AVIF
- Smart Optimize - Automatic best format selection
Using Commands
Press Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (Mac) and type:
Image Optimizer: Select Folder
Image Optimizer: Compress Images
Image Optimizer: Convert Images
Image Optimizer: Smart Optimize
Image Optimizer: Generate Responsive Images
Image Optimizer: Run Doctor
Image Optimizer: Watch Folder
Right-click on any folder in the Explorer to access optimization options directly.
Configuration
Open Settings (Ctrl+,) and search for "Image Optimizer" to customize:
| Setting |
Default |
Description |
imageOptimizer.defaultFormat |
webp |
Default format for conversion |
imageOptimizer.defaultQuality |
80 |
Default compression quality (1-100) |
imageOptimizer.preserveMetadata |
true |
Preserve EXIF metadata |
imageOptimizer.createBackup |
true |
Backup files before removal |
imageOptimizer.backupFolder |
.image-backup |
Backup folder name |
imageOptimizer.outputMode |
keepBoth |
Output mode: replace, keepBoth, customFolder |
imageOptimizer.customOutputFolder |
optimized |
Custom output folder name |
imageOptimizer.responsiveSizes |
[320, 640, 1280, 1920] |
Sizes for responsive images |
imageOptimizer.preset |
custom |
Project preset |
imageOptimizer.maxWidth |
0 |
Maximum width for resize (0 = no limit) |
imageOptimizer.maxHeight |
0 |
Maximum height for resize (0 = no limit) |
imageOptimizer.lossless |
false |
Use lossless compression |
Project Presets
Choose a preset to automatically configure settings for your project type:
| Preset |
Format |
Quality |
Description |
| Custom |
WebP |
80% |
Your own settings |
| Nuxt.js |
WebP |
80% |
Optimized for Nuxt projects |
| Vue.js |
WebP |
80% |
Optimized for Vue projects |
| React |
WebP |
80% |
Optimized for React projects |
| Laravel |
WebP |
85% |
Optimized for Laravel projects |
| Static |
WebP |
75% |
Optimized for static sites |
Commands
| Command |
Description |
imageOptimizer.selectFolder |
Select folder(s) to scan for images |
imageOptimizer.convertImages |
Convert images to a different format |
imageOptimizer.compressImages |
Compress images with configurable quality |
imageOptimizer.smartOptimize |
Auto-select best format per image |
imageOptimizer.generateResponsive |
Generate multiple sizes for responsive design |
imageOptimizer.removeOriginals |
Remove original files (with backup) |
imageOptimizer.undoLast |
Undo the last removal operation |
imageOptimizer.doctor |
Scan for image-related issues |
imageOptimizer.watchFolder |
Start watching folders for new images |
imageOptimizer.stopWatching |
Stop the folder watcher |
imageOptimizer.exportReport |
Export optimization report |
imageOptimizer.openDashboard |
Open the dashboard sidebar |
Compression Modes
| Mode |
Quality |
Use Case |
| Low |
90% |
Minimal compression, highest quality |
| Balanced |
80% |
Good balance for most uses |
| Aggressive |
65% |
Maximum compression, some quality loss |
| Custom |
1-100% |
Set your own quality level |
📱 Responsive Image Generation
Generate multiple sizes for responsive images:
<picture>
<source
type="image/avif"
srcset="image-320w.avif 320w, image-640w.avif 640w, image-1280w.avif 1280w"
sizes="(max-width: 320px) 100vw, 1280px"
/>
<source
type="image/webp"
srcset="image-320w.webp 320w, image-640w.webp 640w, image-1280w.webp 1280w"
sizes="(max-width: 320px) 100vw, 1280px"
/>
<img src="https://github.com/keroloszakaria/image-optimizer-pro/raw/HEAD/image-1280w.jpg" alt="" loading="lazy" decoding="async" />
</picture>
Doctor Mode
Doctor mode scans your project for:
- Large Images - Files over 500KB that should be compressed
- Unused Images - Images not referenced in source files
- Non-Modern Formats - PNG/JPG files that could be WebP/AVIF
📊 Reports
Export optimization reports in two formats:
Markdown Report
# Image Optimization Report
**Generated:** 2026-01-22T10:30:00.000Z
**Operation:** compress
## Summary
| Metric | Value |
| --------------- | -------------- |
| Total Processed | 25 |
| Successful | 25 |
| Original Size | 15.2 MB |
| Output Size | 8.4 MB |
| Saved | 6.8 MB (44.7%) |
JSON Report
{
"id": "report-123456",
"timestamp": "2026-01-22T10:30:00.000Z",
"operationType": "compress",
"result": {
"totalProcessed": 25,
"successful": 25,
"totalSavedPercent": 44.7
}
}
Requirements
- VS Code 1.85.0 or higher
- Node.js 18+ (for development)
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Commit changes:
git commit -m 'Add amazing feature'
- Push to branch:
git push origin feature/amazing-feature
- Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.