{
  "schemaVersion": "1.0",
  "dataset": "KBLimit Browser-Local Compression & RGBA Fidelity Benchmarks",
  "publishedDate": "2026-11-24",
  "sourceUrl": "https://kblimit.com/benchmarks/",
  "reproducibleScript": "scripts/run-phase12-research.mjs",
  "environment": {
    "browser": "Headless Chromium 158.0.8127.37 (playwright-core)",
    "node": "v26.13.0",
    "libraries": {
      "upng-js": "^2.1.0",
      "libheif-js": "^1.23.5",
      "pdf-lib": "^1.17.1",
      "fflate": "^0.8.3",
      "pako": "^2.1.0",
      "react": "^19.1.0"
    }
  },
  "studyA_pngStraightRgbaFidelity": {
    "fixture": {
      "url": "https://kblimit.com/samples/kblimit-rgba-fidelity-fixture.png",
      "width": 128,
      "height": 128,
      "totalPixels": 16384,
      "inputBytes": 65737,
      "inputSha256": "c141c443751c6781f4cd5fa4a9b177620905c0ad337eaee00c082cd2b05839ef",
      "pixelClasses": [
        { "id": "opaque", "label": "Fully Opaque (A = 255)", "count": 4096, "sourceRgba": "Deterministic RGB gradient, A=255" },
        { "id": "mid-alpha", "label": "Mid-Alpha (A = 128)", "count": 4096, "sourceRgba": [199, 83, 41, 128] },
        { "id": "low-alpha", "label": "Low-Alpha (A = 17)", "count": 4096, "sourceRgba": [213, 147, 91, 17] },
        { "id": "alpha-zero", "label": "Fully Transparent Non-Zero RGB (A = 0)", "count": 4096, "sourceRgba": [213, 77, 149, 0] }
      ]
    },
    "pipelines": [
      {
        "id": "kblimit-lossless-worker",
        "name": "KBLimit Lossless PNG (UPNG.js Web Worker)",
        "outputBytes": 14777,
        "sizeChangePct": -77.52,
        "outputSha256": "3cc2797f6a4cbb9c58155403bd450a4e46373b7fce6a02a0d2199e568e7acf58",
        "totalPixelDiffs": 0,
        "classResults": {
          "opaque": { "diffs": 0, "total": 4096, "observedRgba": "Identical (0 diffs)" },
          "mid-alpha": { "diffs": 0, "total": 4096, "observedRgba": [199, 83, 41, 128] },
          "low-alpha": { "diffs": 0, "total": 4096, "observedRgba": [213, 147, 91, 17] },
          "alpha-zero": { "diffs": 0, "total": 4096, "observedRgba": [213, 77, 149, 0] }
        }
      },
      {
        "id": "canvas-2d-roundtrip",
        "name": "Standard HTML5 Canvas 2D (createImageBitmap -> drawImage -> toBlob)",
        "outputBytes": 29851,
        "sizeChangePct": -54.59,
        "outputSha256": "757fedd40b9e1e209289eec4f63ebf1d70bcfc9d5f11f495604d4b5b825cd2a8",
        "totalPixelDiffs": 12288,
        "classResults": {
          "opaque": { "diffs": 0, "total": 4096, "observedRgba": "Identical (0 diffs)" },
          "mid-alpha": { "diffs": 4096, "total": 4096, "observedRgba": [199, 84, 42, 128] },
          "low-alpha": { "diffs": 4096, "total": 4096, "observedRgba": [210, 150, 90, 17] },
          "alpha-zero": { "diffs": 4096, "total": 4096, "observedRgba": [0, 0, 0, 0] }
        }
      },
      {
        "id": "kblimit-lossy-palette-128",
        "name": "KBLimit Lossy Palette (128-color default, reference)",
        "outputBytes": 3659,
        "sizeChangePct": -94.43,
        "outputSha256": "f4a94a41ff086657d9583ead19f047842ddbbc5bbe2b76a13e30160906c23bcf",
        "totalPixelDiffs": null,
        "note": "Intentional lossy palette quantization; preserves alpha=128 and alpha=17 visibility while zeroing alpha=0 palette entries."
      }
    ]
  },
  "studyB_exactKbCompression": [
    { "id": 1, "sample": "sample-photo.jpg", "sourceFormat": "JPG", "originalBytes": 1028663, "origWidth": 1600, "origHeight": 1200, "targetKB": 20, "binaryCapBytes": 20480, "decimalCapBytes": 20000, "outputBytes": 20218, "finalWidth": 787, "finalHeight": 590, "scaled": true, "codecDetail": "JPG Quality 42%", "timeMs": 1122, "targetMetBinary": true, "targetMetDecimal": false, "warning": false },
    { "id": 2, "sample": "sample-photo.jpg", "sourceFormat": "JPG", "originalBytes": 1028663, "origWidth": 1600, "origHeight": 1200, "targetKB": 50, "binaryCapBytes": 51200, "decimalCapBytes": 50000, "outputBytes": 49925, "finalWidth": 1245, "finalHeight": 933, "scaled": true, "codecDetail": "JPG Quality 33%", "timeMs": 405, "targetMetBinary": true, "targetMetDecimal": true, "warning": false },
    { "id": 3, "sample": "sample-photo.jpg", "sourceFormat": "JPG", "originalBytes": 1028663, "origWidth": 1600, "origHeight": 1200, "targetKB": 100, "binaryCapBytes": 102400, "decimalCapBytes": 100000, "outputBytes": 100327, "finalWidth": 1600, "finalHeight": 1200, "scaled": false, "codecDetail": "JPG Quality 30%", "timeMs": 870, "targetMetBinary": true, "targetMetDecimal": false, "warning": false },
    { "id": 4, "sample": "large-photo.jpg", "sourceFormat": "JPG", "originalBytes": 5560324, "origWidth": 3600, "origHeight": 2700, "targetKB": 50, "binaryCapBytes": 51200, "decimalCapBytes": 50000, "outputBytes": 50307, "finalWidth": 1620, "finalHeight": 1215, "scaled": true, "codecDetail": "JPG Quality 38%", "timeMs": 1677, "targetMetBinary": true, "targetMetDecimal": false, "warning": false },
    { "id": 5, "sample": "large-photo.jpg", "sourceFormat": "JPG", "originalBytes": 5560324, "origWidth": 3600, "origHeight": 2700, "targetKB": 100, "binaryCapBytes": 102400, "decimalCapBytes": 100000, "outputBytes": 101487, "finalWidth": 1829, "finalHeight": 1372, "scaled": true, "codecDetail": "JPG Quality 47%", "timeMs": 1570, "targetMetBinary": true, "targetMetDecimal": false, "warning": false },
    { "id": 6, "sample": "large-photo.jpg", "sourceFormat": "JPG", "originalBytes": 5560324, "origWidth": 3600, "origHeight": 2700, "targetKB": 200, "binaryCapBytes": 204800, "decimalCapBytes": 200000, "outputBytes": 199264, "finalWidth": 2587, "finalHeight": 1940, "scaled": true, "codecDetail": "JPG Quality 35%", "timeMs": 2095, "targetMetBinary": true, "targetMetDecimal": true, "warning": false },
    { "id": 7, "sample": "sample-alpha.png", "sourceFormat": "PNG", "originalBytes": 628654, "origWidth": 1024, "origHeight": 768, "targetKB": 50, "binaryCapBytes": 51200, "decimalCapBytes": 50000, "outputBytes": 45967, "finalWidth": 860, "finalHeight": 645, "scaled": true, "codecDetail": "Lossy PNG (32-color, alpha kept)", "timeMs": 2454, "targetMetBinary": true, "targetMetDecimal": true, "warning": true },
    { "id": 8, "sample": "sample-alpha.png", "sourceFormat": "PNG", "originalBytes": 628654, "origWidth": 1024, "origHeight": 768, "targetKB": 100, "binaryCapBytes": 102400, "decimalCapBytes": 100000, "outputBytes": 98741, "finalWidth": 1024, "finalHeight": 768, "scaled": false, "codecDetail": "Lossy PNG (48-color, alpha kept)", "timeMs": 1931, "targetMetBinary": true, "targetMetDecimal": true, "warning": false },
    { "id": 9, "sample": "real-sample.heic", "sourceFormat": "HEIC", "originalBytes": 718114, "origWidth": 1280, "origHeight": 854, "targetKB": 100, "binaryCapBytes": 102400, "decimalCapBytes": 100000, "outputBytes": 101924, "finalWidth": 1075, "finalHeight": 717, "scaled": true, "codecDetail": "HEIC->JPG Quality 38% (single pass)", "timeMs": 1062, "targetMetBinary": true, "targetMetDecimal": false, "warning": false },
    { "id": 10, "sample": "sample-image.webp", "sourceFormat": "WebP", "originalBytes": 524656, "origWidth": 1280, "origHeight": 960, "targetKB": 50, "binaryCapBytes": 51200, "decimalCapBytes": 50000, "outputBytes": 50530, "finalWidth": 902, "finalHeight": 677, "scaled": true, "codecDetail": "WebP Quality 53%", "timeMs": 1384, "targetMetBinary": true, "targetMetDecimal": false, "warning": false },
    { "id": 11, "sample": "large-photo.jpg", "sourceFormat": "JPG", "originalBytes": 5560324, "origWidth": 3600, "origHeight": 2700, "targetKB": 1, "binaryCapBytes": 1024, "decimalCapBytes": 1000, "outputBytes": 1319, "finalWidth": 288, "finalHeight": 216, "scaled": true, "codecDetail": "JPG Quality 10% (Limit 1.00 KB exceeded)", "timeMs": 2308, "targetMetBinary": false, "targetMetDecimal": false, "warning": true },
    { "id": 12, "sample": "sample-alpha.png", "sourceFormat": "PNG", "originalBytes": 628654, "origWidth": 1024, "origHeight": 768, "targetKB": 1, "binaryCapBytes": 1024, "decimalCapBytes": 1000, "outputBytes": 983, "finalWidth": 85, "finalHeight": 64, "scaled": true, "codecDetail": "Lossy PNG (24-color, alpha kept, banding warning)", "timeMs": 2489, "targetMetBinary": true, "targetMetDecimal": true, "warning": true }
  ]
}
