{
  "page": "/blog/pdf-compression-benchmark",
  "date": "2026-11-22",
  "generatedAt": "2026-11-22T17:52:01.826Z",
  "tested": "Six methods (four compression methods, a no-guard variant and linearization) on a 6-file synthetic/sample corpus: output bytes, page count, median runtime of 3 runs, PDF.js text equality, qpdf --check, page-1 PSNR vs original render (PDF.js in Chrome, scale 1.5).",
  "versions": {
    "node": "v24.5.0",
    "pdf-lib": "1.17.1",
    "pdfjs-dist": "5.7.284",
    "playwright-core": "1.65.1",
    "qpdf": "qpdf version 12.4.2",
    "chrome": "158.0.8127.36",
    "ghostscript": "not installed"
  },
  "machine": {
    "cpu": "Apple M4 Max",
    "os": "macOS 27.0",
    "note": "Single developer laptop, local disk, no network involved in measurements."
  },
  "methods": {
    "qpdf-lossless": "qpdf --object-streams=generate --compress-streams=y --recompress-flate --compression-level=9",
    "qpdf-images-q60": "qpdf --optimize-images --jpeg-quality=60 --object-streams=generate --compress-streams=y --recompress-flate --compression-level=9",
    "pdflib-resave": "pdf-lib PDFDocument.load(bytes) then save({ useObjectStreams: true })",
    "chrome-jpeg-q60": "DCTDecode image XObjects decoded in Chrome (createImageBitmap) and re-encoded with OffscreenCanvas.convertToBlob image/jpeg quality 0.6, replaced only if smaller; DeviceRGB/DeviceGray only; then pdf-lib save({ useObjectStreams: true })",
    "chrome-jpeg-q60-always": "Same as chrome-jpeg-q60 but every eligible DCTDecode image is replaced even when the re-encoded JPEG is larger (no guard)",
    "qpdf-linearize": "qpdf --linearize (web-optimized / fast web view; not a compression method)"
  },
  "results": [
    {
      "file": "corpus/text-invoice.pdf",
      "kind": "text",
      "description": "Copy of /samples/invoice/invoice.pdf: 1 page, Chromium-printed, text and vector shapes, no raster images.",
      "bytes": 63998,
      "pages": 1,
      "textChars": 1252,
      "qpdfCheck": "ok",
      "methods": {
        "qpdf-lossless": {
          "output": "outputs/text-invoice.qpdf-lossless.pdf",
          "bytes": 56737,
          "changePct": -11.3,
          "pages": 1,
          "medianMs": 13.7,
          "runsMs": [
            13.8,
            13,
            13.7
          ],
          "textIdentical": true,
          "qpdfCheck": "ok",
          "page1": {
            "renderScale": 1.5,
            "psnrDb": "identical",
            "meanAbsDiff": 0
          },
          "details": {}
        },
        "qpdf-images-q60": {
          "output": "outputs/text-invoice.qpdf-images-q60.pdf",
          "bytes": 56743,
          "changePct": -11.3,
          "pages": 1,
          "medianMs": 13,
          "runsMs": [
            13,
            13.2,
            13
          ],
          "textIdentical": true,
          "qpdfCheck": "ok",
          "page1": {
            "renderScale": 1.5,
            "psnrDb": "identical",
            "meanAbsDiff": 0
          },
          "details": {
            "qpdfVerboseImageLines": 1,
            "optimized": 0,
            "notOptimized": 0
          }
        },
        "pdflib-resave": {
          "output": "outputs/text-invoice.pdflib-resave.pdf",
          "bytes": 57859,
          "changePct": -9.6,
          "pages": 1,
          "medianMs": 1.4,
          "runsMs": [
            2.1,
            1.4,
            1.3
          ],
          "textIdentical": true,
          "qpdfCheck": "ok",
          "page1": {
            "renderScale": 1.5,
            "psnrDb": "identical",
            "meanAbsDiff": 0
          },
          "details": {}
        },
        "chrome-jpeg-q60": {
          "output": "outputs/text-invoice.chrome-jpeg-q60.pdf",
          "bytes": 57859,
          "changePct": -9.6,
          "pages": 1,
          "medianMs": 1.5,
          "runsMs": [
            1.8,
            1.5,
            1.4
          ],
          "textIdentical": true,
          "qpdfCheck": "ok",
          "page1": {
            "renderScale": 1.5,
            "psnrDb": "identical",
            "meanAbsDiff": 0
          },
          "details": {
            "dctImages": 0,
            "replaced": 0,
            "keptOriginal": 0,
            "skipped": [],
            "imageBytesBefore": 0,
            "imageBytesAfterReencode": 0
          }
        },
        "chrome-jpeg-q60-always": {
          "output": "outputs/text-invoice.chrome-jpeg-q60-always.pdf",
          "bytes": 57859,
          "changePct": -9.6,
          "pages": 1,
          "medianMs": 1.2,
          "runsMs": [
            1.4,
            1.2,
            1.1
          ],
          "textIdentical": true,
          "qpdfCheck": "ok",
          "page1": {
            "renderScale": 1.5,
            "psnrDb": "identical",
            "meanAbsDiff": 0
          },
          "details": {
            "dctImages": 0,
            "replaced": 0,
            "keptOriginal": 0,
            "skipped": [],
            "imageBytesBefore": 0,
            "imageBytesAfterReencode": 0
          }
        },
        "qpdf-linearize": {
          "output": "outputs/text-invoice.qpdf-linearize.pdf",
          "bytes": 64959,
          "changePct": 1.5,
          "pages": 1,
          "medianMs": 5.4,
          "runsMs": [
            5.4,
            4.8,
            6.7
          ],
          "textIdentical": true,
          "qpdfCheck": "ok",
          "page1": {
            "renderScale": 1.5,
            "psnrDb": "identical",
            "meanAbsDiff": 0
          },
          "details": {}
        }
      }
    },
    {
      "file": "corpus/text-report.pdf",
      "kind": "text",
      "description": "Copy of /samples/report/report.pdf: 2 pages, Chromium-printed, text and tables, no raster images.",
      "bytes": 113951,
      "pages": 2,
      "textChars": 2887,
      "qpdfCheck": "ok",
      "methods": {
        "qpdf-lossless": {
          "output": "outputs/text-report.qpdf-lossless.pdf",
          "bytes": 102946,
          "changePct": -9.7,
          "pages": 2,
          "medianMs": 14.6,
          "runsMs": [
            14.6,
            14.8,
            14.4
          ],
          "textIdentical": true,
          "qpdfCheck": "ok",
          "page1": {
            "renderScale": 1.5,
            "psnrDb": "identical",
            "meanAbsDiff": 0
          },
          "details": {}
        },
        "qpdf-images-q60": {
          "output": "outputs/text-report.qpdf-images-q60.pdf",
          "bytes": 102955,
          "changePct": -9.6,
          "pages": 2,
          "medianMs": 15.9,
          "runsMs": [
            16.2,
            15.9,
            15.8
          ],
          "textIdentical": true,
          "qpdfCheck": "ok",
          "page1": {
            "renderScale": 1.5,
            "psnrDb": "identical",
            "meanAbsDiff": 0
          },
          "details": {
            "qpdfVerboseImageLines": 1,
            "optimized": 0,
            "notOptimized": 0
          }
        },
        "pdflib-resave": {
          "output": "outputs/text-report.pdflib-resave.pdf",
          "bytes": 105591,
          "changePct": -7.3,
          "pages": 2,
          "medianMs": 1.1,
          "runsMs": [
            1.4,
            1.1,
            1.1
          ],
          "textIdentical": true,
          "qpdfCheck": "ok",
          "page1": {
            "renderScale": 1.5,
            "psnrDb": "identical",
            "meanAbsDiff": 0
          },
          "details": {}
        },
        "chrome-jpeg-q60": {
          "output": "outputs/text-report.chrome-jpeg-q60.pdf",
          "bytes": 105591,
          "changePct": -7.3,
          "pages": 2,
          "medianMs": 1.4,
          "runsMs": [
            1.4,
            1.3,
            1.4
          ],
          "textIdentical": true,
          "qpdfCheck": "ok",
          "page1": {
            "renderScale": 1.5,
            "psnrDb": "identical",
            "meanAbsDiff": 0
          },
          "details": {
            "dctImages": 0,
            "replaced": 0,
            "keptOriginal": 0,
            "skipped": [],
            "imageBytesBefore": 0,
            "imageBytesAfterReencode": 0
          }
        },
        "chrome-jpeg-q60-always": {
          "output": "outputs/text-report.chrome-jpeg-q60-always.pdf",
          "bytes": 105591,
          "changePct": -7.3,
          "pages": 2,
          "medianMs": 1.3,
          "runsMs": [
            1.4,
            1.3,
            1.1
          ],
          "textIdentical": true,
          "qpdfCheck": "ok",
          "page1": {
            "renderScale": 1.5,
            "psnrDb": "identical",
            "meanAbsDiff": 0
          },
          "details": {
            "dctImages": 0,
            "replaced": 0,
            "keptOriginal": 0,
            "skipped": [],
            "imageBytesBefore": 0,
            "imageBytesAfterReencode": 0
          }
        },
        "qpdf-linearize": {
          "output": "outputs/text-report.qpdf-linearize.pdf",
          "bytes": 115004,
          "changePct": 0.9,
          "pages": 2,
          "medianMs": 5.3,
          "runsMs": [
            5.2,
            5.3,
            5.7
          ],
          "textIdentical": true,
          "qpdfCheck": "ok",
          "page1": {
            "renderScale": 1.5,
            "psnrDb": "identical",
            "meanAbsDiff": 0
          },
          "details": {}
        }
      }
    },
    {
      "file": "corpus/image-photos.pdf",
      "kind": "image-heavy",
      "description": "4 landscape A4 pages, each one synthetic photo-like JPEG (2400x1600 px, Chrome canvas JPEG quality 0.92, seeded noise/gradients) plus a Helvetica caption.",
      "embeddedJpegBytes": [
        1386416,
        1384409,
        1356863,
        1365926
      ],
      "bytes": 5497757,
      "pages": 4,
      "textChars": 447,
      "qpdfCheck": "ok",
      "methods": {
        "qpdf-lossless": {
          "output": null,
          "outputNotKept": "within 10% of a >1 MB input; regenerate with the script",
          "bytes": 5496589,
          "changePct": 0,
          "pages": 4,
          "medianMs": 6.7,
          "runsMs": [
            6.6,
            6.7,
            7.4
          ],
          "textIdentical": true,
          "qpdfCheck": "ok",
          "page1": {
            "renderScale": 1.5,
            "psnrDb": "identical",
            "meanAbsDiff": 0
          },
          "details": {}
        },
        "qpdf-images-q60": {
          "output": "outputs/image-photos.qpdf-images-q60.pdf",
          "bytes": 1508195,
          "changePct": -72.6,
          "pages": 4,
          "medianMs": 211.9,
          "runsMs": [
            210.3,
            214.7,
            211.9
          ],
          "textIdentical": true,
          "qpdfCheck": "ok",
          "page1": {
            "renderScale": 1.5,
            "psnrDb": 41.23,
            "meanAbsDiff": 1.386
          },
          "details": {
            "qpdfVerboseImageLines": 5,
            "optimized": 4,
            "notOptimized": 0
          }
        },
        "pdflib-resave": {
          "output": null,
          "outputNotKept": "within 10% of a >1 MB input; regenerate with the script",
          "bytes": 5496532,
          "changePct": 0,
          "pages": 4,
          "medianMs": 16.5,
          "runsMs": [
            16.5,
            16.7,
            7.3
          ],
          "textIdentical": true,
          "qpdfCheck": "ok",
          "page1": {
            "renderScale": 1.5,
            "psnrDb": "identical",
            "meanAbsDiff": 0
          },
          "details": {}
        },
        "chrome-jpeg-q60": {
          "output": "outputs/image-photos.chrome-jpeg-q60.pdf",
          "bytes": 1340071,
          "changePct": -75.6,
          "pages": 4,
          "medianMs": 269.6,
          "runsMs": [
            264.1,
            278,
            269.6
          ],
          "textIdentical": true,
          "qpdfCheck": "ok",
          "page1": {
            "renderScale": 1.5,
            "psnrDb": 41.23,
            "meanAbsDiff": 1.386
          },
          "details": {
            "dctImages": 4,
            "replaced": 4,
            "keptOriginal": 0,
            "skipped": [],
            "imageBytesBefore": 5493614,
            "imageBytesAfterReencode": 1337157
          }
        },
        "chrome-jpeg-q60-always": {
          "output": "outputs/image-photos.chrome-jpeg-q60-always.pdf",
          "bytes": 1340071,
          "changePct": -75.6,
          "pages": 4,
          "medianMs": 258.7,
          "runsMs": [
            258.7,
            260.2,
            256
          ],
          "textIdentical": true,
          "qpdfCheck": "ok",
          "page1": {
            "renderScale": 1.5,
            "psnrDb": 41.23,
            "meanAbsDiff": 1.386
          },
          "details": {
            "dctImages": 4,
            "replaced": 4,
            "keptOriginal": 0,
            "skipped": [],
            "imageBytesBefore": 5493614,
            "imageBytesAfterReencode": 1337157
          }
        },
        "qpdf-linearize": {
          "output": null,
          "outputNotKept": "within 10% of a >1 MB input; regenerate with the script",
          "bytes": 5498348,
          "changePct": 0,
          "pages": 4,
          "medianMs": 7.5,
          "runsMs": [
            7.5,
            7.5,
            7.6
          ],
          "textIdentical": true,
          "qpdfCheck": "ok",
          "page1": {
            "renderScale": 1.5,
            "psnrDb": "identical",
            "meanAbsDiff": 0
          },
          "details": {}
        }
      }
    },
    {
      "file": "corpus/scan-invoice.pdf",
      "kind": "scanned-like",
      "description": "/samples/invoice/invoice-long.pdf (4 pages) rendered with PDF.js in Chrome at 200 dpi, grayscale, +/-6 noise, 0.4 degree rotation, JPEG quality 0.85; one image per page, no text layer.",
      "pagePixels": [
        [
          1653,
          2339
        ],
        [
          1653,
          2339
        ],
        [
          1653,
          2339
        ],
        [
          1653,
          2339
        ]
      ],
      "bytes": 1272702,
      "pages": 4,
      "textChars": 3,
      "qpdfCheck": "ok",
      "methods": {
        "qpdf-lossless": {
          "output": null,
          "outputNotKept": "within 10% of a >1 MB input; regenerate with the script",
          "bytes": 1271632,
          "changePct": -0.1,
          "pages": 4,
          "medianMs": 5.3,
          "runsMs": [
            5.4,
            5.1,
            5.3
          ],
          "textIdentical": true,
          "qpdfCheck": "ok",
          "page1": {
            "renderScale": 1.5,
            "psnrDb": "identical",
            "meanAbsDiff": 0
          },
          "details": {}
        },
        "qpdf-images-q60": {
          "output": "outputs/scan-invoice.qpdf-images-q60.pdf",
          "bytes": 598134,
          "changePct": -53,
          "pages": 4,
          "medianMs": 118.8,
          "runsMs": [
            118.3,
            118.8,
            118.8
          ],
          "textIdentical": true,
          "qpdfCheck": "ok",
          "page1": {
            "renderScale": 1.5,
            "psnrDb": 43.07,
            "meanAbsDiff": 1.114
          },
          "details": {
            "qpdfVerboseImageLines": 5,
            "optimized": 4,
            "notOptimized": 0
          }
        },
        "pdflib-resave": {
          "output": null,
          "outputNotKept": "within 10% of a >1 MB input; regenerate with the script",
          "bytes": 1271573,
          "changePct": -0.1,
          "pages": 4,
          "medianMs": 3.7,
          "runsMs": [
            3.7,
            3.1,
            6.4
          ],
          "textIdentical": true,
          "qpdfCheck": "ok",
          "page1": {
            "renderScale": 1.5,
            "psnrDb": "identical",
            "meanAbsDiff": 0
          },
          "details": {}
        },
        "chrome-jpeg-q60": {
          "output": "outputs/scan-invoice.chrome-jpeg-q60.pdf",
          "bytes": 478627,
          "changePct": -62.4,
          "pages": 4,
          "medianMs": 129.8,
          "runsMs": [
            129.7,
            133.5,
            129.8
          ],
          "textIdentical": true,
          "qpdfCheck": "ok",
          "page1": {
            "renderScale": 1.5,
            "psnrDb": 43.07,
            "meanAbsDiff": 1.114
          },
          "details": {
            "dctImages": 4,
            "replaced": 4,
            "keptOriginal": 0,
            "skipped": [],
            "imageBytesBefore": 1269468,
            "imageBytesAfterReencode": 476525
          }
        },
        "chrome-jpeg-q60-always": {
          "output": "outputs/scan-invoice.chrome-jpeg-q60-always.pdf",
          "bytes": 478627,
          "changePct": -62.4,
          "pages": 4,
          "medianMs": 124.8,
          "runsMs": [
            124.8,
            121.9,
            127.9
          ],
          "textIdentical": true,
          "qpdfCheck": "ok",
          "page1": {
            "renderScale": 1.5,
            "psnrDb": 43.07,
            "meanAbsDiff": 1.114
          },
          "details": {
            "dctImages": 4,
            "replaced": 4,
            "keptOriginal": 0,
            "skipped": [],
            "imageBytesBefore": 1269468,
            "imageBytesAfterReencode": 476525
          }
        },
        "qpdf-linearize": {
          "output": null,
          "outputNotKept": "within 10% of a >1 MB input; regenerate with the script",
          "bytes": 1273282,
          "changePct": 0,
          "pages": 4,
          "medianMs": 6.7,
          "runsMs": [
            6.7,
            7.1,
            6.7
          ],
          "textIdentical": true,
          "qpdfCheck": "ok",
          "page1": {
            "renderScale": 1.5,
            "psnrDb": "identical",
            "meanAbsDiff": 0
          },
          "details": {}
        }
      }
    },
    {
      "file": "corpus/image-lowq.pdf",
      "kind": "image-heavy (already compressed)",
      "description": "2 landscape A4 pages, each one synthetic photo-like JPEG (2400x1600 px) already saved at Chrome canvas JPEG quality 0.45, plus a Helvetica caption.",
      "embeddedJpegBytes": [
        239065,
        236432
      ],
      "bytes": 478015,
      "pages": 2,
      "textChars": 171,
      "qpdfCheck": "ok",
      "methods": {
        "qpdf-lossless": {
          "output": "outputs/image-lowq.qpdf-lossless.pdf",
          "bytes": 477362,
          "changePct": -0.1,
          "pages": 2,
          "medianMs": 4.9,
          "runsMs": [
            5.2,
            4.8,
            4.9
          ],
          "textIdentical": true,
          "qpdfCheck": "ok",
          "page1": {
            "renderScale": 1.5,
            "psnrDb": "identical",
            "meanAbsDiff": 0
          },
          "details": {}
        },
        "qpdf-images-q60": {
          "output": "outputs/image-lowq.qpdf-images-q60.pdf",
          "bytes": 477362,
          "changePct": -0.1,
          "pages": 2,
          "medianMs": 26.7,
          "runsMs": [
            26.7,
            26.7,
            27.2
          ],
          "textIdentical": true,
          "qpdfCheck": "ok",
          "page1": {
            "renderScale": 1.5,
            "psnrDb": "identical",
            "meanAbsDiff": 0
          },
          "details": {
            "qpdfVerboseImageLines": 3,
            "optimized": 0,
            "notOptimized": 2
          }
        },
        "pdflib-resave": {
          "output": "outputs/image-lowq.pdflib-resave.pdf",
          "bytes": 477289,
          "changePct": -0.2,
          "pages": 2,
          "medianMs": 1.3,
          "runsMs": [
            1.4,
            1.3,
            0.9
          ],
          "textIdentical": true,
          "qpdfCheck": "ok",
          "page1": {
            "renderScale": 1.5,
            "psnrDb": "identical",
            "meanAbsDiff": 0
          },
          "details": {}
        },
        "chrome-jpeg-q60": {
          "output": "outputs/image-lowq.chrome-jpeg-q60.pdf",
          "bytes": 477289,
          "changePct": -0.2,
          "pages": 2,
          "medianMs": 69,
          "runsMs": [
            72.5,
            67.3,
            69
          ],
          "textIdentical": true,
          "qpdfCheck": "ok",
          "page1": {
            "renderScale": 1.5,
            "psnrDb": "identical",
            "meanAbsDiff": 0
          },
          "details": {
            "dctImages": 2,
            "replaced": 0,
            "keptOriginal": 2,
            "skipped": [],
            "imageBytesBefore": 475497,
            "imageBytesAfterReencode": 497279
          }
        },
        "chrome-jpeg-q60-always": {
          "output": "outputs/image-lowq.chrome-jpeg-q60-always.pdf",
          "bytes": 499071,
          "changePct": 4.4,
          "pages": 2,
          "medianMs": 64.4,
          "runsMs": [
            64.4,
            66.8,
            63
          ],
          "textIdentical": true,
          "qpdfCheck": "ok",
          "page1": {
            "renderScale": 1.5,
            "psnrDb": 46.38,
            "meanAbsDiff": 0.74
          },
          "details": {
            "dctImages": 2,
            "replaced": 2,
            "keptOriginal": 0,
            "skipped": [],
            "imageBytesBefore": 475497,
            "imageBytesAfterReencode": 497279
          }
        },
        "qpdf-linearize": {
          "output": "outputs/image-lowq.qpdf-linearize.pdf",
          "bytes": 478603,
          "changePct": 0.1,
          "pages": 2,
          "medianMs": 4.8,
          "runsMs": [
            5.2,
            4.8,
            4.8
          ],
          "textIdentical": true,
          "qpdfCheck": "ok",
          "page1": {
            "renderScale": 1.5,
            "psnrDb": "identical",
            "meanAbsDiff": 0
          },
          "details": {}
        }
      }
    },
    {
      "file": "corpus/text-report-preoptimized.pdf",
      "kind": "text (already optimized)",
      "description": "text-report.pdf after the qpdf-lossless method (object streams, Flate level 9): tests what happens when an optimized file is optimized again.",
      "bytes": 102946,
      "pages": 2,
      "textChars": 2887,
      "qpdfCheck": "ok",
      "methods": {
        "qpdf-lossless": {
          "output": "outputs/text-report-preoptimized.qpdf-lossless.pdf",
          "bytes": 102946,
          "changePct": 0,
          "pages": 2,
          "medianMs": 15.6,
          "runsMs": [
            15.6,
            15.7,
            15.2
          ],
          "textIdentical": true,
          "qpdfCheck": "ok",
          "page1": {
            "renderScale": 1.5,
            "psnrDb": "identical",
            "meanAbsDiff": 0
          },
          "details": {}
        },
        "qpdf-images-q60": {
          "output": "outputs/text-report-preoptimized.qpdf-images-q60.pdf",
          "bytes": 102955,
          "changePct": 0,
          "pages": 2,
          "medianMs": 16.8,
          "runsMs": [
            17.5,
            16.7,
            16.8
          ],
          "textIdentical": true,
          "qpdfCheck": "ok",
          "page1": {
            "renderScale": 1.5,
            "psnrDb": 74.71,
            "meanAbsDiff": 0
          },
          "details": {
            "qpdfVerboseImageLines": 1,
            "optimized": 0,
            "notOptimized": 0
          }
        },
        "pdflib-resave": {
          "output": "outputs/text-report-preoptimized.pdflib-resave.pdf",
          "bytes": 103102,
          "changePct": 0.2,
          "pages": 2,
          "medianMs": 5.9,
          "runsMs": [
            6.8,
            5.9,
            3.7
          ],
          "textIdentical": true,
          "qpdfCheck": "ok",
          "page1": {
            "renderScale": 1.5,
            "psnrDb": 74.71,
            "meanAbsDiff": 0
          },
          "details": {}
        },
        "chrome-jpeg-q60": {
          "output": "outputs/text-report-preoptimized.chrome-jpeg-q60.pdf",
          "bytes": 103102,
          "changePct": 0.2,
          "pages": 2,
          "medianMs": 1.9,
          "runsMs": [
            3,
            1.9,
            1.9
          ],
          "textIdentical": true,
          "qpdfCheck": "ok",
          "page1": {
            "renderScale": 1.5,
            "psnrDb": 74.71,
            "meanAbsDiff": 0
          },
          "details": {
            "dctImages": 0,
            "replaced": 0,
            "keptOriginal": 0,
            "skipped": [],
            "imageBytesBefore": 0,
            "imageBytesAfterReencode": 0
          }
        },
        "chrome-jpeg-q60-always": {
          "output": "outputs/text-report-preoptimized.chrome-jpeg-q60-always.pdf",
          "bytes": 103102,
          "changePct": 0.2,
          "pages": 2,
          "medianMs": 1.9,
          "runsMs": [
            2.2,
            1.8,
            1.9
          ],
          "textIdentical": true,
          "qpdfCheck": "ok",
          "page1": {
            "renderScale": 1.5,
            "psnrDb": "identical",
            "meanAbsDiff": 0
          },
          "details": {
            "dctImages": 0,
            "replaced": 0,
            "keptOriginal": 0,
            "skipped": [],
            "imageBytesBefore": 0,
            "imageBytesAfterReencode": 0
          }
        },
        "qpdf-linearize": {
          "output": "outputs/text-report-preoptimized.qpdf-linearize.pdf",
          "bytes": 104517,
          "changePct": 1.5,
          "pages": 2,
          "medianMs": 5.6,
          "runsMs": [
            5.8,
            5.6,
            5.5
          ],
          "textIdentical": true,
          "qpdfCheck": "ok",
          "page1": {
            "renderScale": 1.5,
            "psnrDb": 74.71,
            "meanAbsDiff": 0
          },
          "details": {}
        }
      }
    }
  ],
  "limitations": [
    "Six files only; synthetic and self-produced. Not representative of real-world PDFs.",
    "Runtime includes process spawn for qpdf and Chrome round-trips for the re-encode method; single laptop, 3 runs, median reported.",
    "PSNR compares page-1 renders at 1.5x (108 dpi) by PDF.js in Chrome; it is a coarse proxy, not a perceptual quality study.",
    "The chrome-jpeg-q60 method approximates the approach SublimePDF's compress tool is described to use (JPEG re-encode then re-save); it is not the tool itself.",
    "Ghostscript was not installed on the test machine (which gs: not found) and was not installed for this test; Acrobat and online compressors were not tested either.",
    "PDF.js rendering in Chrome is not perfectly deterministic: byte-identical files occasionally differ by a few pixels (PSNR around 75 dB). Treat PSNR above about 70 dB as identical.",
    "Regenerating the corpus is not guaranteed to be byte-identical (canvas JPEG encoding); the committed corpus files are the reference inputs for the published numbers.",
    "Renders at 1.5x downsample the 2400 px photos, so PSNR understates fine-detail loss in the image-heavy files."
  ]
}
