๐Ÿ”ฌ Compression Science

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.

โฑ๏ธ 6 min read ๐Ÿ“… Updated October 2026 ๐ŸŽฏ Advanced

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

  1. Open the Compressor: Go to the FileWorks Image Compression Tool.
  2. Drop Your Images: Drag and drop up to 10 MB total of JPG, PNG, or WebP files.
  3. Tune the Quality Slider: Use the interactive slider (set by default to 80%, the optimal sweet spot). FileWorks calculates savings in real time.
  4. Compress & Inspect: Click Compress Images. Compare the before and after byte sizes directly on the result card.
  5. 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.

Open Image Compressor โ†’

Frequently Asked Questions

Does FileWorks compression upload my photos to the cloud?
No. FileWorks encodes images entirely inside an off-screen HTML5 Canvas context in your browser's local memory. Your photos never touch a network server.
Why didn't my PNG file shrink when using the quality slider?
PNG is a strictly lossless format and does not use DCT quality quantization. To compress PNGs aggressively, convert them to modern WebP using the Image Convert Tool, which achieves 70%+ size reductions while preserving full transparency.