● onlineping: build: 15cd939
6 posts published_
ImageCompressor

ImageCompressor

PublicC
Release · Published 3 days ago
  • Recommended setting: When an image is loaded, it shows the estimated size and reduction ratio at "visually lossless" quality (JPEG 85). Safe lower bound: quality 70 — below that, the loss becomes visible to the eye.
  • Percentage compression: You pick the JPEG quality from 1–100.
  • Downscale by pixels/resolution: by percentage, target width, or target height (aspect kept).
  • Target-size mode: Say "this file should be at most 200 KB" and the tool adjusts the quality (and, if needed, the resolution) automatically to fit.
  • Unicode path support: Paths with non-ASCII characters work (e.g. Turkish: Masaüstü, ç/ş/ü) via UTF-8.
  • Input: JPG, PNG, BMP, TGA, GIF (first frame), PSD. Output: JPG (highest compression). Transparent (alpha) areas are flattened onto a white background.

Build

A C compiler is required (MinGW-GCC recommended):

winget install --id BrechtSanders.WinLibs.POSIX.UCRT -e

Open a new terminal in the project folder:

build.bat

This produces imgcompress.exe. (Manually: gcc -O2 -std=c11 -o imgcompress.exe main.c -lm)

Usage

Interactive (menu) mode — just run it:

imgcompress.exe

By passing an image directly:

imgcompress.exe "C:\Users\...\photo.png"

With options (no menu):

imgcompress.exe photo.jpg -q 80
imgcompress.exe photo.jpg --scale 50
imgcompress.exe photo.jpg --width 1280
imgcompress.exe photo.jpg --target 200      REM at most 200 KB
imgcompress.exe photo.jpg -q 85 -o small.jpg
Option Description
-q <1-100> JPEG quality percentage (default 85)
--scale <%> Downscale dimensions to a percentage
--width <px> Downscale by width (aspect kept)
--height <px> Downscale by height (aspect kept)
--target <KB> Target file size; find quality automatically
-o <output> Output file (default <name>_compressed.jpg)
← all projectsGitHub ↗
ESC
↑↓ navigate openesc close