What Is Image Compression? How It Works and Why Files Get Smaller
Table of Contents
Every time you take a photo on your phone, compress a file for email, or optimize an image for a website, compression is involved. But most explanations go straight into technical terms — discrete cosine transforms, entropy coding, chroma subsampling — without explaining what's actually happening to your image.
Here's the plain-English version: what image compression is, what it does to your file, and why some compression hurts quality while some doesn't.
What Image Compression Actually Is
An uncompressed image stores the color of every pixel as individual numbers. A 1920x1080 pixel image has 2,073,600 pixels. If each pixel uses 3 bytes of data (red, green, blue values), that's 6.2MB just for the raw pixel data — before any overhead.
Image compression reduces the file size by storing this data more efficiently. There are two ways to do it:
Lossless compression — finds patterns in the data and represents them more compactly, without discarding any information. Think of it like finding a shorter way to say the same thing. The original image can be perfectly reconstructed from the compressed data.
Lossy compression — throws away information that human vision is unlikely to notice. It's a one-way process: the discarded data is gone. The result is a smaller file that looks similar to the original but is not identical at the pixel level.
PNG uses lossless compression. JPEG uses lossy compression. Most compression tools let you choose how aggressively to compress, which determines how much data is discarded.
How JPEG Compression Reduces File Size
JPEG compression takes advantage of two properties of human vision:
1. We're more sensitive to brightness than color. JPEG stores brightness information at full resolution but reduces the color information spatially — a process called chroma subsampling. Most viewers don't notice this because our eyes follow luminance (brightness) more than color.
2. We don't notice small details in complex textures. JPEG divides the image into 8x8 pixel blocks, analyzes the patterns within each block, and throws away fine detail that the eye is unlikely to detect. A smooth area like a wall or sky keeps most of its data. A complex area like hair or fabric loses more fine detail.
The "quality" setting controls how aggressively this process works:
- Quality 90-100: Minimal data loss — the file is still much larger than quality 80, with almost no visible difference
- Quality 75-85: The practical sweet spot — 50-70% file size reduction with no perceptible quality loss
- Quality 50-70: Significant reduction, may show artifacts in smooth areas (gradients, skin tones, sky)
- Quality below 50: Heavy compression — visible block artifacts, color banding, blurry edges
Most image compressors default to quality 80-85% for this reason — it's the point where file size reduction is maximized before visible quality loss appears.
Sell Custom Apparel — We Handle Printing & Free ShippingHow PNG Compression Works Differently
PNG uses a lossless algorithm called DEFLATE, combined with pre-processing filters that make the data more compressible. Here's the simplified version:
Before compression, PNG applies prediction filters to each row of pixels. Instead of storing the color value of each pixel directly, it stores the difference from a predicted value based on neighboring pixels. Since adjacent pixels in most images are similar colors, these differences are often very small numbers — and small numbers compress better than large ones.
The DEFLATE algorithm then runs LZ77 compression (finding repeated patterns and encoding them as pointers) followed by Huffman coding (using fewer bits for common values, more bits for rare values). Together, these can reduce a typical image by 20-60% without losing any data.
Why PNG files are bigger than JPEG: PNG doesn't discard any information, so it can't achieve the same compression ratios as JPEG for photographic content. But PNG produces better results for images with sharp edges, text, and large areas of solid color — and it's the only common format that preserves transparency.
What Happens When You Adjust the Quality Slider
Most compression tools (including this one) show a quality slider from 0-100. Here's what moving it actually changes:
- Moving toward 100: Less data is discarded. More of the original detail is preserved. File size stays larger.
- Moving toward 0: More data is discarded. The encoder is more aggressive about what it considers "unimportant." File size decreases dramatically, but so does quality.
The default in this tool is 80% — calibrated to achieve significant file size reduction (typically 50-70%) while staying well above the threshold where most viewers notice quality loss.
When should you go lower? When hitting a specific file size target matters more than perfect quality — uploading to a government portal (see visa photo compression guide), meeting a form's file limit, or optimizing thumbnails that are displayed at small sizes.
When should you go higher? When you're compressing a photo that will be printed, displayed at large size, or used as a source file for further editing. Start at 85-90% and only reduce if necessary.
Try It Free — No Signup Required
Runs 100% in your browser. No data is collected, stored, or sent anywhere.
Open Free Image CompressorFrequently Asked Questions
What does compressing an image do?
Compressing an image reduces its file size by encoding the pixel data more efficiently. Lossless compression preserves every pixel. Lossy compression discards data that human vision is unlikely to notice, achieving much smaller files.
Does compressing an image reduce its quality?
Lossless compression (PNG): no — the image is pixel-perfect after compression. Lossy compression (JPEG): yes, but at quality settings of 75-85%, the quality loss is invisible at normal viewing conditions.
What is a JPEG quality setting?
JPEG quality controls how aggressively the encoder discards image data. Quality 80% means more data is preserved than quality 50%. Higher quality = larger file size. Lower quality = smaller file, more compression artifacts.
How much can an image be compressed?
For JPEG, typical compression at quality 80% reduces files by 50-70%. More aggressive compression at quality 50% can reduce by 80-90%. At quality 30%, files are 90%+ smaller but show visible artifacts. The practical limit depends on image content.
Is it bad to compress an image multiple times?
For JPEG, yes — each re-compression compounds quality loss. The artifacts from the first compression get re-encoded with new artifacts on the second pass. Always start from the highest-quality original, not a previously compressed version.

