Image Compressor (Quality & Target KB Mode)
Compress images by quality or target KB with batch ZIP export & EXIF removal.
EXIF & GPS location metadata are stripped automatically on output.
How to Use
- Select or drop one or more JPG, PNG, or WebP images from your device.
- Choose Quality Slider mode (10%–95%) or Target Size in KB mode (e.g., 200 KB for online portal uploads).
- Click Compress Images to process locally via Canvas / OffscreenCanvas, inspect before/after sizes, and download individually or as a ZIP archive.
Tips, Accuracy & Limits
- EXIF, GPS coordinates, and camera metadata are stripped by default when images are re-encoded in your browser.
- Target KB mode runs an iterative binary quality search; if a photo still exceeds the target at minimum quality, dimensions are scaled down proportionally.
- Very large images are clamped to 8,192 px max dimension to stay within mobile browser memory limits.
Worked Example
Compressing a 2.4 MB smartphone JPEG (3024 × 4032 px) for a Pakistan visa or job portal with a 200 KB limit:
- Upload the 2.4 MB photo and select 'Target KB' mode set to 190 KB (leaving a 10 KB safety buffer).
- Set max dimension to 1600 px if full 12 MP resolution is unnecessary.
- Run compression — binary-search quality tuning converges near ~68% JPEG quality at ~184 KB.
- Download the compressed JPEG and verify sharp text/facial detail in the preview.
Common Mistakes to Avoid
- Setting Target KB to exactly 200 KB when a portal enforces < 200 KB (200 × 1000 vs 200 × 1024 bytes); always aim 5–10% below the limit.
- Compressing a PNG screenshot containing crisp UI text as low-quality JPEG, which introduces ringing artifacts around letters instead of using WebP.
- Repeatedly re-compressing an already lossy JPEG across multiple saves, compounding block artifacts.
Practical Guide & Technical Notes
Browser-based image compression uses the HTML5 Canvas encoder (`canvas.toBlob`) to re-encode raster pixels locally without uploading personal documents, IDs, or photos. Because JPEG and WebP use lossy perceptual quantization, reducing quality from 95% to 75–82% typically cuts file size by 60–80% while remaining visually indistinguishable at normal viewing distances.
When an online government or university portal specifies a strict maximum file size (such as 100 KB, 200 KB, or 500 KB), guessing a single quality slider often requires multiple manual retries. Target-KB mode automates a binary search over the encoder quality parameter and optional dimension scaling until the output blob fits cleanly underneath your byte budget.
Keep in mind that PNG is lossless: adjusting a quality slider does not shrink a 24-bit PNG. For photographs and scanned documents, converting PNG to JPEG or WebP yields dramatic savings. Also note that re-encoding via Canvas strips EXIF metadata (such as GPS coordinates and camera serial numbers), which improves privacy when sharing photos online.