How JPEG Quality Works
When you save a JPEG at “quality 85,” you are not telling the encoder to keep 85% of the original image data. The quality number controls quantization tables — lookup matrices that determine how aggressively the encoder rounds the output of the Discrete Cosine Transform (DCT).
Here is a simplified version of what happens when an image is compressed to JPEG:
- Color space conversion. The image is converted from RGB to YCbCr — one luminance (brightness) channel and two chrominance (color) channels. Human eyes are far more sensitive to brightness than color, so the color channels can be compressed more aggressively.
- Block splitting. Each channel is divided into 8×8 pixel blocks.
- DCT transformation. Each block is transformed from spatial domain (pixel values) to frequency domain (DCT coefficients). Low-frequency coefficients represent smooth gradients; high-frequency coefficients represent fine detail and edges.
- Quantization. This is where data is permanently discarded. Each DCT coefficient is divided by a value from the quantization table and rounded to the nearest integer. Higher quality settings use smaller divisors (less rounding, less data loss). Lower quality settings use larger divisors (more rounding, more data loss, smaller files).
- Entropy coding. The quantized coefficients are compressed further using lossless Huffman coding to produce the final file.
The quality number scales the quantization table. At Q100, the divisors are tiny (minimal rounding). At Q10, the divisors are large (aggressive rounding that destroys most fine detail). The relationship between the quality number and file size is nonlinear — the biggest file size savings happen in the Q95–Q85 range, not at the bottom of the scale.
Key insight: JPEG quality is not a percentage. Q50 does not mean “half the quality of Q100.” It means “use a specific quantization table that happens to be about halfway up the aggression scale.” The perceptual impact of each step varies enormously depending on where you are on the scale.
Quality Benchmark Comparison
To understand the real-world impact of quality settings, consider a typical 24-megapixel photograph (6000×4000 pixels) converted from a lossless PNG source. The PNG weighs approximately 25–35 MB. Here is how each JPEG quality level compares:
| Quality | Approx. File Size | % of PNG Size | Visual Difference | Typical Use |
|---|---|---|---|---|
| Q100 | 8–12 MB | ~35% | Imperceptible | Archival (but not lossless) |
| Q95 | 4–6 MB | ~18% | Imperceptible | Professional photography |
| Q92 | 3–5 MB | ~14% | Imperceptible | High-quality print, e-commerce |
| Q85 | 1.5–3 MB | ~8% | Barely noticeable at 200% zoom | Web sweet spot, blogs, galleries |
| Q80 | 1–2 MB | ~6% | Noticeable only when zoomed in | Social media, general web |
| Q70 | 600–900 KB | ~3% | Visible softening, ringing around edges | Thumbnails, previews |
| Q50 | 300–500 KB | ~1.5% | Obvious artifacts, blocking | Extreme compression only |
The standout finding: Q95 is already half the size of Q100, yet both are visually imperceptible from the PNG original. By Q85, the file is roughly 8% the size of the original PNG — a 12x reduction — and the vast majority of viewers cannot tell the difference from Q100 on a normal display at normal viewing distance.
The “Quality Cliff”
JPEG compression has a characteristic curve that surprises most people. The relationship between quality setting and file size is not linear, and neither is the relationship between quality setting and perceptual quality.
The sweet spot: Q95 to Q85
Between quality 95 and 85, file size drops by 50–60% while perceptual quality changes are nearly invisible. This is the region where JPEG compression is most efficient — the encoder is discarding high-frequency data that human vision barely registers.
Think of it this way: the first coefficients to be quantized away are the ones representing the finest, most subtle textures — film grain, pixel-level noise, barely-visible gradients. Your eyes were not detecting that data in the first place.
The danger zone: Q80 to Q60
Below quality 80, each additional drop in quality number produces a smaller file size reduction but a larger visual degradation. The encoder has already removed the easy-to-discard high-frequency data and is now cutting into mid-frequency information that your eyes do notice — edge definition, color gradients in skin tones, detail in shadow areas.
This is the “quality cliff.” Between Q80 and Q60:
- Ringing artifacts appear around high-contrast edges (text on backgrounds, tree branches against sky).
- Blocking artifacts become visible — the 8×8 pixel grid pattern shows through in smooth gradient areas like blue skies.
- Color banding replaces smooth gradients with visible steps.
- Mosquito noise — shimmering artifacts around sharp edges — becomes noticeable.
The practical rule
You get the most value from JPEG compression in the Q85–Q95 range. Going above Q95 doubles file size for no visible benefit. Going below Q80 saves relatively little file size while introducing visible degradation. The exact threshold varies by image content — photographs with smooth gradients (skies, skin) show artifacts sooner than busy textures (foliage, gravel).
Chroma Subsampling Interaction
There is a hidden setting that changes at certain quality thresholds: chroma subsampling. This is how JPEG exploits the fact that human vision is less sensitive to color detail than brightness detail.
| Subsampling | What It Means | When It Kicks In | Visual Impact |
|---|---|---|---|
| 4:4:4 | Full color resolution | Q ≥ 90 (ImageMagick default) | No color blurring |
| 4:2:0 | Color resolution halved in both dimensions | Q < 90 (ImageMagick default) | Slight color blurring at sharp edges |
In ImageMagick (which powers our converter), the threshold is quality 90. At Q90 and above, the encoder uses 4:4:4 subsampling — every pixel gets its own color information. Below Q90, it switches to 4:2:0 — color resolution is reduced to one quarter of the luminance resolution.
For photographs, this switch is almost invisible. The human eye processes color at much lower resolution than brightness, so 4:2:0 looks identical in natural images with organic textures.
For screenshots, text, graphics, and UI elements, the switch can be noticeable. Sharp color boundaries — red text on white background, colored icons, thin colored lines — may show slight color bleeding at 4:2:0. If your PNG contains text or sharp graphics, consider keeping quality at 90 or above to preserve 4:4:4 subsampling.
Convertio pipeline: Our converter uses convert input.png -quality 92 -flatten -background white -alpha remove -colorspace sRGB output.jpg. Quality 92 ensures 4:4:4 chroma subsampling for maximum color fidelity.
Recommended Settings by Use Case
There is no single “best” quality setting. The right choice depends on where the image will be used, who will see it, and how much file size matters.
| Use Case | Recommended Quality | Reasoning |
|---|---|---|
| Blog / editorial | Q80–Q85 | Fast page loads matter more than pixel-perfect detail. Readers are reading text, not pixel-peeping photos. |
| Social media | Q75–Q80 | Platforms re-compress uploads anyway. Uploading at Q95 wastes bandwidth — Instagram will re-encode to ~Q70. |
| E-commerce products | Q85–Q90 | Product detail influences purchase decisions. Q85 is sufficient for most products; Q90 for jewelry, fabrics, and watches. |
| Portfolio / photography | Q90–Q95 | Photographers scrutinize images. Higher quality preserves subtle tonal gradations and ensures 4:4:4 chroma. |
| Print (brochures, posters) | Q92–Q95 | Print at 300 DPI magnifies artifacts. Higher quality ensures clean output even at close viewing distance. |
| Archival backup | Q95+ | If you must use JPEG for archival, maximize quality. But consider keeping the original PNG instead. |
| Thumbnails / previews | Q65–Q75 | Small display size hides artifacts. File size is critical — a grid of 50 thumbnails at Q85 adds up fast. |
| Email attachments | Q80–Q85 | Stay under attachment size limits while keeping images sharp enough for on-screen viewing. |
JPEG Q100 Is NOT Lossless
This is one of the most common misconceptions in image processing. Setting JPEG quality to 100 does not produce a lossless file. Here is why:
- DCT rounding is always lossy. The Discrete Cosine Transform converts pixel values to floating-point frequency coefficients. These coefficients must be rounded to integers for storage. Even with the gentlest quantization table (Q100), this rounding introduces permanent errors.
- Color space conversion introduces rounding. Converting from RGB to YCbCr and back involves floating-point math with rounding at each step.
- Chroma subsampling may still apply. Depending on the encoder, even Q100 may use 4:2:0 subsampling, reducing color resolution.
In practice, Q100 JPEG is visually indistinguishable from the original. The PSNR (Peak Signal-to-Noise Ratio) is typically above 50 dB, which corresponds to differences invisible to the human eye. But if you need bit-for-bit identical reproduction — for medical imaging, scientific data, or pixel art — JPEG at any quality level is the wrong format.
When you need truly lossless
- PNG — the standard lossless format. Larger files, but every pixel is preserved exactly.
- WebP (lossless mode) — 25–35% smaller than PNG while remaining lossless.
- AVIF (lossless mode) — even smaller, but slower to encode and limited browser support.
- TIFF (LZW/ZIP) — lossless with compression, widely supported in professional workflows.
Pro tip: If you are converting PNG to JPG specifically for file size reduction, the whole point is to accept a small amount of lossy compression. Q85–Q92 gives you the best return — massive size reduction with imperceptible quality loss. Saving at Q100 defeats much of the purpose of converting to JPEG in the first place.
Re-Saving and Generation Loss
Every time a JPEG is opened, edited, and saved again, the DCT/quantization cycle runs again. Each cycle discards additional data. This is called generation loss, and it accumulates:
- First save (from PNG): Small, controlled loss determined by your quality setting.
- Second save (from JPEG): The encoder re-quantizes already-quantized data. Artifacts compound, especially at lower quality levels.
- Third save and beyond: Quality degrades noticeably with each generation. After 5–10 saves at Q85, the image shows obvious blocking and color shifts.
The practical rule: Always edit from the original PNG (or other lossless source) and export to JPEG as the final step. Never use a JPEG as the starting point for edits if the lossless source is available. If you must re-save a JPEG, use Q95 or higher to minimize additional loss.
Beyond the Quality Slider
The quality number is not the only factor that determines JPEG file size. Several other techniques can reduce file size without touching the quality setting:
Progressive encoding
Progressive JPEGs store the image in multiple scans (blurry to sharp) instead of top-to-bottom. For images larger than 10 KB, progressive encoding typically produces files 1–3% smaller than baseline encoding at the same quality level. It also improves perceived loading speed on slow connections.
Metadata stripping
EXIF metadata (camera model, GPS, date, thumbnails) can add 10–100 KB to each file. For web images where metadata is not needed, stripping it provides a meaningful size reduction — especially for images from professional cameras that embed large thumbnail previews and ICC profiles.
Resolution reduction
If your PNG is 4000×3000 pixels but the image will only be displayed at 800×600 on a website, resizing before compression produces a dramatically smaller file — roughly 25x smaller at the same quality setting (area reduction is quadratic). Always resize to the display size (or 2x for Retina displays) before setting quality.
Color space
Converting from a wide color space (Adobe RGB, Display P3) to sRGB before JPEG encoding ensures consistent display across all browsers and devices. It also removes the embedded ICC profile, saving 1–4 KB. Our converter handles this automatically.
Try Different Quality Settings
The best way to find the right quality for your images is to experiment. Upload a PNG below and convert it to JPG. Compare the output at different quality levels to see where your personal threshold of “good enough” lands. For most web use, that threshold is Q80–Q85. For photography and print, it is Q90–Q95.