How Image Compression Changes File Size & Quality: Lossy vs. Lossless Explained
When you slide a quality slider from 90% down to 70%, what actually happens to your image's pixels? Explore the mathematics of lossy quantization, the diminishing returns of high-quality settings, and how to find the optimal sweet spot.
The Core Mathematics: Quantization Matrices
In lossy compression algorithms (like JPEG and lossy WebP), images are converted from spatial pixels into frequency coefficients using the Discrete Cosine Transform (DCT) in 8 ร 8 pixel blocks.
The step that actually eliminates file bytes is quantization:
The Quantization Equation
Quantized Value = Round( DCT Coefficient / Quantization Table Value )
When you lower the "Quality" slider, the numbers in the divisor table increase. Higher divisors force smaller high-frequency numbers to round down to zero.
Long sequences of zeroes are extraordinarily cheap to compress using Huffman or arithmetic entropy coding. That is why lower quality settings result in dramatically smaller file sizes.
The Non-Linear Sweet Spot Curve
The relationship between the Quality percentage setting and file size is not linear. It follows a steep exponential curve:
| Quality Setting | Typical File Size (12 MP Photo) | Visual Perception (Human Eye) | Recommended Use |
|---|---|---|---|
| 100% | 8.5 MB | Identical to source; quantization tables set to minimal division. | Archival masters; highly inefficient for web delivery. |
| 90% | 3.2 MB (62% reduction) | Imperceptible difference even at 200% magnification. | Photography portfolios and print brochures. |
| 80% (Sweet Spot) | 1.1 MB (87% reduction) | Completely sharp to human eyes on desktop and mobile screens. | General web publishing, blogs, e-commerce. |
| 60% | 520 KB (94% reduction) | Minor blockiness in high-frequency foliage or fine text. | Thumbnails, mobile news feeds. |
| 30% | 210 KB (97% reduction) | Obvious 8x8 macroblock grid artifacts and color banding. | Extreme bandwidth-constrained environments. |
Generational Degradation (The Re-compression Trap)
One of the most destructive mistakes users make is repeatedly saving a lossy image.
โ ๏ธ Generational Loss in Action
If you open a JPEG, rotate it, save it, open it again tomorrow, crop it, and save it again at 80%, each generation recalculates the DCT and rounds new coefficients to zero. By generation 4 or 5, smooth skin tones develop harsh color stepping, and sharp edges blur into noticeable halo rings.
Best Practice: Always perform editing operations on your raw or lossless source image, and perform lossy compression only as the very final export step.
Step-by-Step: Compressing Images with FileWorks
- Open the Compressor: Go to the FileWorks Image Compression Tool.
- Drop Your Images: Drag and drop up to 10 MB total of JPG, PNG, or WebP files.
- Tune the Quality Slider: Use the interactive slider (set by default to 80%, the optimal sweet spot). FileWorks calculates savings in real time.
- Compress & Inspect: Click Compress Images. Compare the before and after byte sizes directly on the result card.
- Download: Download individual compressed files or grab the entire batch as an organized ZIP.
Optimize Your Photos Now
Interactive quality tuning with live file savings calculations in your browser.