Squint 0.7.0
Pre-releaseA PDF is a wrapper around pictures, and Squint now shrinks the pictures. From the command line in this release; the application follows (#70).
A PDF is rewritten as itself. A scanned document is a handful of JPEGs with a page around each: measured across real files, a 14 MB scan is thirty 300 dpi JPEGs, an 11 MB product sheet is one image stored with no compression at all, and the text and vectors together are a rounding error against either. Each picture is lifted out, put through the same encode a standalone JPEG gets, and put back where it was. The page tree, the content streams and the fonts are not touched, so the document stays selectable and searchable. The scan came out at 3.0 MB (21%), the sheet at 183 KB (1.6%), and an 88-page study guide from Word at 49%.
Resolution is capped at 150 dpi against the page. A picture is placed on a page by a transformation matrix, not by its own pixel count, so a smaller picture drawn by the same matrix covers the same area at a lower resolution, and no content stream is rewritten. The cap is where most of the saving is: re-encoding alone takes an eighth off a 300 dpi scan, the cap halves it. 120 dpi is visibly soft on scanned text and costs OCR, so 150 is the cap and it is not a control.
Strip works on a PDF. The info dictionary (author, application, dates) and every XMP packet in the document go, from the catalog and from any page, picture or font that carries one, and no pixel is touched.
What is left alone. Fax-coded pages, JPEG 2000 (#69), CMYK, indexed palettes, stencil masks, and the soft masks that carry another picture's transparency each keep the bytes they arrived with. A picture whose colours are defined by an ICC profile keeps the profile, as it does in every other format here. A document that would not come out smaller is refused, as everything else is.
A PDF does not become a picture. --format avif on one is refused with a sentence that says so, rather than quietly writing a PDF.
Changes: #65.
Not notarized. macOS will refuse to open it on first launch: System Settings, Privacy & Security, scroll down, Open Anyway. Control-click and Open no longer bypasses Gatekeeper on Sequoia and later. Requires macOS 14.
SHA-256
a9da9b553d55d56f713082c0b066ed1488cbe21f62d8fc345fe73bfd73421972 Squint-0.7.0.dmg
8bd7ab5f41ca3cf05d5025ad168b49063a0a52154f02010b9aaccf36a0b1534c Squint-0.7.0.zip