Compress Images Tool – Quickly reduce image file sizes from the command line. Supports batch processing, adjustable quality, and PNG/JPEG/WebP formats. Multi-threaded and lightweight, perfect for developers and content creators who want smaller images without losing quality.
The image compressor uses a configuration file config.txt generated automatically in the same folder as the executable or script. Below are all configurable options, their default values, and what they control:
| Option | Default | Description |
|---|---|---|
MAX_SIZE_MB |
10 |
Maximum file size in MB for compressed images. Files larger than this will be resized/compressed further. |
THREADS |
4 |
Number of threads to use for parallel compression. Determines how many files are processed simultaneously. |
SCROLL_LINES |
20 |
Number of log lines displayed in the console dashboard at once. Older lines scroll off. |
LOG_ENABLED |
1 |
Enables saving a plain text log of all processed files (1 = yes, 0 = no). Log file is saved next to the config file with a timestamped name. |
SOUND_ON_COMPLETE |
1 |
Plays a success sound when all files are processed (1 = yes, 0 = no). Uses system sound SystemAsterisk on Windows. |
QUALITY_START |
95 |
Initial quality for JPEG/WebP images during compression (higher = better quality, larger file). |
QUALITY_MIN |
20 |
Minimum quality allowed during compression. Prevents images from being over-compressed to very low quality. |
RESIZE_STEP |
0.85 |
Factor by which image dimensions are reduced when trying to meet MAX_SIZE_MB. Smaller values shrink faster but more aggressively. |
RESIZE_MIN_DIM |
50 |
Minimum width/height to which images will be resized. Images smaller than this will not shrink further. |
_compressedfiles are automatically skipped from re-processing.- Skipped files are logged with explicit reasons (already under max size, already compressed, etc.).
- Log files include every file processed, time taken, reason for skip/failure, and a final summary.
- The configuration file is generated automatically if missing; users can edit it to customize behavior.
Drag and drop a folder onto the executable to process all images inside it.
- The console dashboard will display live progress, including Processing, Compressed, Skipped, Failed statuses, a progress bar, ETA, and space saved.
- No command line arguments are required—simply drag and drop the target folder.
Drag and drop the source code folder onto the included batch file to generate the executable.
- The batch file will compile the code and create the
.exein the same folder. - No additional tools or command line knowledge is required—just drag and drop.
Processing files will display a live dashboard in the terminal, showing the status of each file, progress, and summary:
Processing: _IMG1001.jpg (14.73 MB)
Skipped: _IMG1002.jpg (7.05 MB) Reason: Already under max size
Compressed: _IMG1003.jpg (19.34 MB -> 7.24 MB)
Processing: _IMG1004.jpg (18.21 MB)
Progress: |██████████----------------------------| 37.50% ETA: 52.3s
Files: 3/8 Compressed: 1 Skipped: 1 Failed: 0
Space Saved: 12.10 MB
Once complete, the tool will play a success sound (if enabled) and display the final summary:
Compression complete!
Total files: 8 Compressed: 5 Skipped: 2 Failed: 1
Total space saved: 42.56 MB
A detailed log file log-YYYYMMDD-HHMMSS.txt is saved next to the config file, recording all file results, reasons, and time taken.
v1.0
Preliminary test build.
v1.1
Multithreading and basic dashboard design with logs.
v1.2
Improved dashboard design with more robust processing, skipping files that are already compressed.
v1.3
Added config file, more configuration options, and better error handling.