{
  "name": "Kompixa Browser Image Benchmark",
  "version": "2.1",
  "published": "2026-07-31",
  "purpose": "Measure image output size, browser encoding time and sampled pixel fidelity without uploading source images or using a hidden server encoder.",
  "measurementProtocol": {
    "warmupRepeats": 1,
    "measuredRepeats": 3,
    "reportedTiming": "Median of the three measured canvas.toBlob durations.",
    "timingSamplesExported": true,
    "noiseFlag": "A row is flagged when the measured timing spread is large relative to its median or robust median absolute deviation.",
    "losslessPsnr": "PNG is reported as an infinite/lossless baseline rather than using a finite placeholder value."
  },
  "modes": {
    "quick": {
      "scenes": 12,
      "distribution": "3 scenes in each of 4 categories",
      "qualities": [0.6, 0.8, 0.9],
      "use": "Compare the effect of three quality settings quickly."
    },
    "matched": {
      "scenes": 24,
      "distribution": "6 scenes in each of 4 categories",
      "qualities": [0.5, 0.6, 0.7, 0.8, 0.9],
      "use": "Create a denser quality ladder for approximate closest-PSNR and closest-file-size JPEG versus WebP comparisons."
    },
    "full": {
      "scenes": 100,
      "distribution": "25 scenes in each of 4 categories",
      "qualities": [0.82],
      "use": "Measure a broader deterministic corpus with a practical default quality."
    }
  },
  "sceneCategories": [
    {
      "name": "Photo-like detail",
      "construction": "Gradients, deterministic block noise, translucent circles and a dark foreground band.",
      "purpose": "Approximate mixed color, texture and smooth-tone behavior without claiming to represent real photography."
    },
    {
      "name": "Interface and text",
      "construction": "Flat panels, borders, repeated short line shapes, controls and one-pixel details. No platform font rendering is required.",
      "purpose": "Represent screenshots, UI graphics and sharp edges."
    },
    {
      "name": "Transparent graphic",
      "construction": "Transparent canvas, radial alpha gradients, translucent shapes, borders and line blocks.",
      "purpose": "Measure alpha preservation and expose JPEG flattening."
    },
    {
      "name": "Flat illustration",
      "construction": "Solid-color shapes, lines and limited palettes generated from deterministic seeds.",
      "purpose": "Represent logos, posters and illustrations with broad flat regions."
    }
  ],
  "determinism": {
    "seedBase": 20260731,
    "note": "Drawing instructions and pseudo-random seeds are fixed. Browser rasterization, color management, scheduling and encoders may still differ across browsers, operating systems and versions."
  },
  "formats": {
    "PNG": "One browser-encoded PNG lossless baseline per scene.",
    "WebP": "Browser WebP encoder at the mode quality settings.",
    "JPEG": "Browser JPEG encoder at the mode quality settings. Transparent scenes are composited onto white first.",
    "AVIF": "Optional and included only when the current browser successfully returns an image/avif Blob."
  },
  "metrics": {
    "bytes": "Median encoded Blob size across the measured repeats. Blob sizes are normally deterministic for a fixed scene and browser encoder.",
    "encodeMilliseconds": "Median of three performance.now durations around canvas.toBlob after one unreported warm-up encode.",
    "timingRange": "Minimum and maximum of the three measured durations, exported with every row.",
    "savingPercent": "1 - encoded bytes / same-scene PNG baseline bytes.",
    "psnrDb": "PSNR calculated on a 128-pixel-wide sampled rendering. RGBA channels are compared; JPEG uses a white-composited reference. Exact matches are represented as infinite/lossless rather than 99 dB.",
    "transparency": "Preserved, flattened to white or not applicable."
  },
  "comparisons": {
    "closestSampledPsnr": "For each scene, choose the JPEG/WebP pair with the smallest PSNR gap among quality values sampled in the selected mode, then summarize WebP size difference.",
    "closestSampledSize": "For each scene, choose the JPEG/WebP pair with the closest encoded size among quality values sampled in the selected mode, then summarize WebP PSNR difference.",
    "warning": "These are approximate sampled comparisons and do not prove that nominal quality controls or encoder psychovisual behavior are equivalent."
  },
  "exports": [
    "CSV raw measurements including all three timing samples",
    "JSON environment, measurement protocol, aggregates, category summaries, comparisons and raw measurements",
    "Standalone HTML report with aggregate, category, comparison and raw tables"
  ],
  "limitations": [
    "Synthetic scenes do not represent every photograph, screenshot, logo or production asset.",
    "PSNR is a sampled pixel metric and is not a complete model of human visual quality.",
    "Three measured repeats reduce one-off scheduling noise but do not make browser timing a laboratory-grade performance measurement.",
    "Encoding time includes browser, operating-system and device effects and should not be generalized to other systems.",
    "Browser encoders and color-management behavior can change between versions.",
    "Closest-quality and closest-size comparisons are limited to the discrete quality values sampled by the selected mode.",
    "The benchmark does not compare server-side proprietary encoders unless those results are supplied separately."
  ]
}