# Paimon paper laboratory

The PNG files are original assets downloaded from the official Genshin Impact landing page:
https://webstatic.mihoyo.com/ys/event/obt-landing/index.html

Paimon and Genshin Impact artwork © HoYoverse / miHoYo. `sources.json` records original URLs, dimensions, SHA-256 hashes, and retrieval date.

All conversion tests use the original Paimbnails Paint C++ pipeline compiled to WebAssembly. `paint-bridge.cpp` calls `buildPlan` with `ImportMode::Paint` and renders the result with `renderPlanFrame`. The original implementation files are compiled without edits; `sources.json` records their revision and individual hashes. `paint-engine.js` and `paint-engine.wasm` were compiled with Emscripten 3.1.69, LLVM 19, C++23, and optimization level O2. The browser worker uses one thread and does not require shared memory.

`vendor/LICENSE-emscripten.txt` preserves the notices shipped with the Debian Emscripten toolchain, including its standard library. It does not assign a license to Paimbnails or the artwork.

The interactive Paint laboratory normalizes an official image to 320 × 240 opaque pixels. Controls select a requested dimension from 16 to 320 and the color limit. It uses `paint-lab-bridge.cpp`, `paint-lab-runtime.js`, and the `paint-lab-engine.js` / `paint-lab-engine.wasm` module. The plan may lower the effective dimension during its own review. The optional curve runs seven real conversions at dimensions 16, 32, 64, 96, 160, 240, and 320. Its object budget is 50,000. `paimon-lab-core.js` only supplies common visual metrics. `sources.json` records the laboratory module separately under `paintLaboratory`.

`benchmark-worker.js` compares Paint with the original Geometrize Haxe JavaScript engine used by the Geometrize2GD workflow. The pinned upstream revision, hash, and MIT license are included in `sources.json` and `vendor/`. The Geometrize2GD importer itself is not executed in the browser.

Both methods receive the same opaque 96 × 96 input on RGB(6,14,15), using contain scaling with high quality canvas smoothing. Budgets are 128, 256, and 512 objects, with one warmup and three recorded passes using seeds 1337, 7331, and 2026. Execution order alternates. Paint requests dimension 96 and 24 colors, keeps the background, uses smooth sampling, and disables glow, automatic resolution selection, dithering, looping, and motion. Its original adaptive budget checks remain active. Geometrize receives circles, ellipses, and rotated ellipses with alpha 255, 50 candidates, and mutation parameter 100. Its initial solid background counts as one figure.

Timing uses `performance.now` and includes preparation, geometry generation, and bitmap output. Paint also includes input/output memory copies and plan metadata extraction. Its original renderer uses an integer scale from 1 to 8, then the bridge normalizes output with bilinear sampling to the common target dimensions. Downloading, image decoding, shared input normalization, WebAssembly initialization, metrics, and UI updates are excluded. RMSE, PSNR, and mean Oklab distance compare the whole opaque canvas, including the background. Per-metric medians can come from different passes. Output images use seed 1337; Paint is deterministic and does not consume the random seed.

`benchmark-results.json` contains the environment, settings, individual passes, native plan metadata, medians, and hashes of normalized input bytes. `benchmark-results.csv` contains the summary table. `outputs/` contains normalized references and measured reconstructions.

Open the paper and select **Ejecutar 3 pasadas** to repeat the selected case. **Descargar JSON** saves that run's measurements, settings, source provenance, and normalized input hash. Results describe these browser runtimes and do not measure native Geode conversion speed, GD import time, FPS, or sprite fidelity inside the game.
