JPEG quality — what the number actually controls
"JPEG quality" is a 0–100 number that appears in every photo encoder and almost no two tools mean the same thing by it. The number is not a percentage of preserved information; it is not a quality metric in any objective sense; and 100 is not "lossless". JPG2PDF doesn't expose a quality knob — the tool picks a target quality and either passes the source JPEG through untouched or re-encodes once to that target. This article explains what the number controls under the hood and why the JPG2PDF default is what it is.
How JPEG actually works
JPEG splits an image into 8×8 blocks, transforms each block from pixel values to frequency coefficients via a Discrete Cosine Transform (DCT), then divides each coefficient by a corresponding entry in an 8×8 quantization table. The quotient is rounded to an integer. Lossy compression happens at this rounding step — fine details (high-frequency coefficients) often round to zero.
The quantization table determines how aggressively each coefficient is rounded. Larger numbers in the table → more aggressive rounding → more lost detail. The table for the human-eye-sensitive low frequencies (top-left of the 8×8 grid) typically has small numbers (10–20); the table for high frequencies (bottom-right) has larger numbers (80–120).
The "quality" knob
The IJG (Independent JPEG Group) reference encoder defines a single number (0–100) that scales the reference quantization table. The scaling rule:
if Q < 50: scale = 5000 / Q
else: scale = 200 - 2 × Q
scaled_table[i] = (reference_table[i] × scale + 50) / 100
At Q=50, scale=100, table values are unchanged (the "reference" quality). At Q=85, scale=30 — the table values are 30% of the reference, so coefficients round less aggressively. At Q=100, scale=0 — but the implementation clamps the minimum value to 1, so even Q=100 quantizes by 1, which is a near-no-op for already-integer DCT coefficients.
This is why "Quality 100" is not lossless: the DCT itself uses floating-point arithmetic, then rounds to integers; even with a quantization table of all 1s, you lose sub-integer precision at the DCT output.
Every encoder uses different tables
The 0–100 number is not a standard. Each JPEG encoder has its own quantization tables and its own mapping from "quality" to those tables:
- The IJG libjpeg reference (most open-source tools).
- Photoshop uses a 0–12 scale internally with proprietary tables; the "Save As JPEG" dialog maps 0–12 to its own quality model.
- iPhone Photos / iOS uses tables tuned for skin tones and Apple's color-managed pipeline.
- Some modern encoders ship hand-tuned quantization tables specifically tuned for visual perception, producing smaller files at the same nominal quality number than the IJG reference.
- Google Guetzli uses an iterative algorithm that effectively builds custom tables per image.
Comparing "Q=85 from Photoshop" with "Q=85 from libjpeg" can produce noticeably different images at the same numeric setting. There is no universal mapping.
What JPG2PDF does about quality
For input JPEGs at quality ≤90, JPG2PDF preserves the original quantization tables exactly. The photo's DCT data passes through into the PDF unchanged. For sources at higher quality (Q=95+), JPG2PDF recompresses once to Q=90 — a small generation of quality loss in exchange for a smaller file.
The recompress trigger is simple: if the source's estimated quality is greater than 90, or if the quality couldn't be estimated from the quantization tables, the file is re-encoded at Q=90 before embedding. Otherwise the original DCT data passes through into the PDF unchanged.
Non-JPEG inputs that the tool accepts (PNG, HEIC, WebP, AVIF, etc.) take a different code path entirely — those are documented in the format-specific articles in this family.
Why Q=90?
Q=90 sits in the safe zone for photographic content: barely distinguishable from the original on close inspection, with about 30% file-size savings vs Q=95. The libjpeg-recommended "high quality" range is 85–95; JPG2PDF picks the upper end of that range to err toward fidelity rather than size. (CombinePDF, which mixes photos with other content, defaults to Q=85 instead.)
When the default is wrong for you
If your input photos are already heavily compressed (downloaded from social media, shared via messaging apps), they may already be at Q=70 or lower. JPG2PDF detects this and skips recompression — the source's own Q is preserved. The output PDF is no better than the input but no worse either.
If you have RAW or studio-grade JPEGs at Q=95+, JPG2PDF will recompress them down to its target Q=90. The fidelity drop is barely visible but technically present. To avoid it, recompress yourself to ≤Q=90 before uploading; that path takes the lossless branch with no further quality loss.