A lot of client work ends with the same small chore: a folder of PDFs has to go up to some portal that caps uploads, and the cheapest tool on a Mac is the one already installed. In Preview that is File → Export → Quartz Filter → Reduce File Size. It costs nothing, it scripts easily, and the name promises exactly one thing. Four PDFs and a constructed file went through it on an Apple-silicon Mac, one run each, and the bytes and the extracted text were compared afterwards. Three of the five did not get the promised thing.
Four ordinary files and one constructed file
The samples were a 2-page document with one large photo (T1, 2,312,093 bytes), the same two pages rendered as a 300 DPI scan with no text layer (T2, 2,357,639 bytes), a 10-page text-only PDF (X1, 137,782 bytes) and an 8-page image-and-text report from NASA (X2, 1,497,423 bytes). Image-and-text sample: NASA/JPL "Mars Exploration Rover" NASA Facts (2004), Wikimedia Commons, public domain. The other samples are self-made with fictional content, and the photo in T1 comes from Wikimedia Commons (CC0).
The browser tool I use for this, ImgIng https://imging.ai/ , ran the same files in a desktop browser on its default ebook preset, which recompresses embedded images. After every run the extracted text was compared character by character against the original.
| File | Original | Preview filter | Browser tool, ebook preset |
|---|---|---|---|
| T1 text + photo | 2,312,093 | 190,237 (−91.8%) | 160,010 (−93.1%) |
| T2 scan | 2,357,639 | 1,030,409 (−56.3%) | 637,933 (−72.9%) |
| X1 text only, 10 pages | 137,782 | 142,400 (+3.4%) | 131,156 (−4.8%) |
| X2 NASA report | 1,497,423 | 1,499,640 (+0.15%) | 841,439 (−43.8%) |
The photo file is where the filter earns its name. T1 dropped from 2.31 MB to 0.19 MB with the text intact. The scan lost a bit over half its size.
The text-only PDF came back larger
X1 went from 137,782 to 142,400 bytes. The output is 4,618 bytes heavier. The text itself survived; extraction matched the original exactly.
Why it grew was not investigated. What the byte breakdown does show is why the file was never going to shrink much in the first place. About 88% of X1's bytes are the embedded font. Content streams are around 9%, and the page objects plus the cross-reference table are under 3%. If the filter mostly targets images, which is an assumption here, it has nothing to work with. Even qpdf 12.4.0 with object streams and level-9 Flate turned on only got X1 down to 130,933 bytes (−4.97%), and the browser tool, which had no images to recompress, landed at a similar −4.8%. On this file, about 5% was the ceiling across everything tried, and the filter went the other direction.
The constructed file is worse. It is five one-page quotes stitched together, where the same 800×600 JPEG (91,844 bytes) and the same font subset are each stored five times, 756,741 bytes in total. It is an extreme case built to isolate duplicates, not something typical. The filter did collapse the five copies of the image into one, but that single remaining image was 1,135,629 bytes, and the font came out at 130,614. Total: 1,275,546 bytes, 68.6% larger than what went in. A filter that merged the image copies and still grew the file by 68.6% is the one result in this set I'd most like an explanation for. The cause was not investigated.
Six characters changed in the NASA report
X2 grew by only 2,217 bytes (+0.15%), which on a size check alone looks like "nothing happened". The text check said otherwise: comparing extracted text against the original, 6 characters no longer matched. The browser tool's output of the same file kept all 23,561 characters identical while dropping to 841,439 bytes.
Which characters changed, and why, was not checked. One fact that may or may not matter: this NASA file does not embed its fonts, while T1 and X1 do. That is a guess at a direction, not a cause. Six characters sounds trivial until it is a figure in a quote, an account number, or a name on a contract a client is about to sign, and nobody rereads the pages after the export.
Two checks before the batch runs
None of this means Preview's filter is bad. On the photo-heavy file it saved 91.8%, close to the browser tool, and it is free and offline. The checking just has to happen in the batch, not in the export.
The size check is the obvious one: if the output is not smaller than the input, keep the original. That alone would have caught X1 and the constructed file, and it would have flagged X2 as pointless. The second check is the one people skip, comparing extracted text before and after. It is a few lines with a library such as PyMuPDF, and it is the only check here that shows X2's output was not just pointless but different.
What this set can't answer is whether the six changed characters come from the missing embedded fonts or from something in how the filter rewrites the page. That needs a sample with unembedded fonts and no images, which this set didn't include.
Top comments (0)