PNG size experiment / PNG 体积实验 / PNG ファイル容量の実験
Recorded on 2026-10-07 (Asia/Shanghai).

Files:
  png-size-lab.py: controlled generator; Python 3.9+ standard library.
  png-size-verify.cjs: independent decoder plus Sharp export demonstration.
  png-size-lab/: generated PNGs, manifest.json and verification.json.

Reproduce from this directory:
  python3 png-size-lab.py png-size-lab
  node png-size-verify.cjs png-size-lab

The second command requires Node.js and an existing Sharp installation that
can be loaded with require('sharp'). Alternatively set GUMI_SHARP_MODULE to
the absolute path of an existing Sharp package, then run the same command.
The experiment used Node.js 24.19.0 and Sharp 0.35.4 supplied by its runtime.
Generator and decoder versions are recorded in the JSON files.

Generation rewrites the named generated fixtures in the chosen output folder.
The verifier checks their file hashes, independently reconstructs each input,
decodes with Sharp/libvips/libpng and compares complete raw RGB byte arrays.
Seven hand-encoded files match their respective reference input exactly.
gradient-sub-9-changed.png is an intentional negative control: one RGB byte
is different. A false match for that file is the expected result.
The verifier also exports gradient-sharp-optimized.png and compares its RGB
with the source. Different encoder versions may produce different file sizes.

Scope: generated 256x128, non-interlaced, 8-bit RGB fixtures without alpha or
colour profiles. This is not an optimizer or equivalence checker for arbitrary
user images, metadata, high-bit-depth images, transparency or animations.

References:
  https://www.w3.org/TR/png-3/
  https://zlib.net/manual.html
  https://sharp.pixelplumbing.com/api-output/#png
  https://sharp.pixelplumbing.com/api-output/#raw
  https://sharp.pixelplumbing.com/api-output/#keepmetadata
