A lightweight VS Code extension for compressing and optimizing images. Supports JPEG, PNG, WebP, AVIF, GIF, TIFF formats with customizable compression settings.
Features
Compress various image formats (JPEG, PNG, WebP, AVIF, GIF, TIFF)
Batch compression of selected images
Compress all images in a folder (non-recursive)
Automatically creates output folders with incremental naming
Progress indication during compression
Demo
Supported Formats
JPEG/JPG
PNG
WebP
AVIF
GIF
TIFF/TIF
Usage
Compress Selected Images:
Open the command palette (Ctrl+Shift+P or Cmd+Shift+P)
Run Compress Images in Folder
Select one or multiple images to compress
Compress Images in Folder:
Open the command palette (Ctrl+Shift+P or Cmd+Shift+P)
Run Compress Images in Folder
Select a folder containing images to compress (only images in the selected folder, not subfolders)
Installation
Install from VS Code Marketplace
Search for "img2small"
Click Install
Running the Extension Locally
Run npm install in terminal to install dependencies
Run the Run Extension target in the Debug View. This will:
Start a task npm: watch to compile the code
Run the extension in a new VS Code window
Configuration
The extension uses a default quality setting of 80 for compression. To adjust compression settings, you can modify the source code.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.