# Resize Image to KB: reproducible synthetic examples

Measured 2026-09-05 using Google Chrome, headless Chromium 152.0.7977.83.

These are original synthetic examples: abstract pen-like curves on transparency and a seeded noisy color chart. They contain no real signature, photograph, or personal information. The source PNGs and generated JPEGs are included so anyone can inspect and repeat the examples.

| Example | Required pixels | Maximum bytes | Actual bytes | Decoded pixels | Checks |
|---|---|---:|---:|---|---|
| [strokes-300x80-max20kb](./strokes-300x80-max20kb.jpg) | 300 × 80 | 20000 | 14308 | 300 × 80 | Pass |
| [chart-300x300-max100kb](./chart-300x300-max100kb.jpg) | 300 × 300 | 100000 | 94178 | 300 × 300 | Pass |
| [chart-300x300-impossible100bytes](./chart-300x300-impossible100bytes.jpg) | 300 × 300 | 100 | 1426 | 300 × 300 | Size fails; dimensions pass |

Read [benchmark.json](./benchmark.json) for exact inputs, checks, browser details, and SHA-256 hashes. One KB means 1,000 bytes. The 100-byte case deliberately fails; it does not silently reduce the required dimensions.

## Reproduce

From the repository webapp directory with Node 22, installed dependencies, and Google Chrome:

```sh
node scripts/benchmark-resize-image-to-kb.mjs
```

The default writes to tests/ui/output/resize-image-to-kb-benchmark. Set CHROME_PATH for another Chromium installation. BENCHMARK_BASE_URL may point to an existing local Vite development server; otherwise the script starts and stops Vite on port 4187 (overridable with BENCHMARK_PORT). It uses an isolated browser context and does not load the site UI or analytics.

Use `node scripts/benchmark-resize-image-to-kb.mjs --publish` only when intentionally replacing these public sample assets. Re-running the default command does not change this public directory.

## Limits

These examples establish the recorded file bytes and decoded pixels for these inputs and this browser. They do not establish typical compression rates, visual quality, legibility, or acceptance by any external form. Browser encoders and rasterization can change; byte-identical reproduction across versions or operating systems is not promised. Encoder quality is a setting, not a measured quality score.

## Reuse

To the extent permitted by law, JPEGConvert contributors dedicate the original synthetic fixtures, generated result images, and measurement data in this directory to the public domain under [CC0 1.0 Universal](https://creativecommons.org/publicdomain/zero/1.0/). You may copy, modify, and reuse them without requesting permission. No third-party source images were used.
