Apply the same transform in publish and preview; no new dependencies, processes, services, or request-time work.
Keep success logging in the existing transform runner; no additional per-card log.
Include a patch changeset.
Impact and tradeoffs
Same-input benchmarks on three existing local demo cards using these exact settings:
Sample
Original PNG
Optimized PNG
Reduction
Extra encoding time
Book
392,557 bytes
119,035 bytes
70%
~308 ms
Film
350,892 bytes
93,538 bytes
73%
~319 ms
Code snippet
34,225 bytes
15,614 bytes
54%
~83 ms
These are illustrative local samples, not a whole-archive performance guarantee. Palette encoding is lossy: reducing the available colors can affect photographs, gradients, shadows, and antialiased edges. The owner rendered additional previews and reported acceptable visual quality. Existing files are only changed when regenerated; this PR does not trigger a bulk republish.
Verification
Worker ESLint: passed.
Worker TypeScript build: passed.
Full worker suite: 45 files, 277 tests passed with coverage.
Changed Open Graph transform: 100% statements, branches, functions, and lines covered.
Real Sharp tests cover a smaller valid PNG, dimensions and semitransparency, keeping a smaller original, encoding-error propagation without writing an output, and prior-asset forwarding.
git diff --check: passed.
Verification used installed project executables directly because pnpm attempted to read an npm config denied by the session sandbox. No dependencies were installed or changed.
Review scope
Only the worker transform, its tests, and changeset are included. Existing local demo archive edits and generated images are excluded.
## Summary
Closes #112.
Reduce final Open Graph image sizes with the existing Sharp dependency, after Takumi renders the card:
- Encode a palette PNG with `quality: 90`, `effort: 7`, and `compressionLevel: 9`.
- Keep the original buffer if the optimized PNG is not smaller.
- Preserve dimensions, transparency support, paths, asset records, and `image/png` MIME types.
- Apply the same transform in publish and preview; no new dependencies, processes, services, or request-time work.
- Keep success logging in the existing transform runner; no additional per-card log.
- Include a patch changeset.
## Impact and tradeoffs
Same-input benchmarks on three existing local demo cards using these exact settings:
| Sample | Original PNG | Optimized PNG | Reduction | Extra encoding time |
| --- | ---: | ---: | ---: | ---: |
| Book | 392,557 bytes | 119,035 bytes | 70% | ~308 ms |
| Film | 350,892 bytes | 93,538 bytes | 73% | ~319 ms |
| Code snippet | 34,225 bytes | 15,614 bytes | 54% | ~83 ms |
These are illustrative local samples, not a whole-archive performance guarantee. Palette encoding is lossy: reducing the available colors can affect photographs, gradients, shadows, and antialiased edges. The owner rendered additional previews and reported acceptable visual quality. Existing files are only changed when regenerated; this PR does not trigger a bulk republish.
## Verification
- Worker ESLint: passed.
- Worker TypeScript build: passed.
- Full worker suite: **45 files, 277 tests passed** with coverage.
- Changed Open Graph transform: **100% statements, branches, functions, and lines covered**.
- Real Sharp tests cover a smaller valid PNG, dimensions and semitransparency, keeping a smaller original, encoding-error propagation without writing an output, and prior-asset forwarding.
- `git diff --check`: passed.
Verification used installed project executables directly because pnpm attempted to read an npm config denied by the session sandbox. No dependencies were installed or changed.
## Review scope
Only the worker transform, its tests, and changeset are included. Existing local demo archive edits and generated images are excluded.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Closes #112.
Reduce final Open Graph image sizes with the existing Sharp dependency, after Takumi renders the card:
quality: 90,effort: 7, andcompressionLevel: 9.image/pngMIME types.Impact and tradeoffs
Same-input benchmarks on three existing local demo cards using these exact settings:
These are illustrative local samples, not a whole-archive performance guarantee. Palette encoding is lossy: reducing the available colors can affect photographs, gradients, shadows, and antialiased edges. The owner rendered additional previews and reported acceptable visual quality. Existing files are only changed when regenerated; this PR does not trigger a bulk republish.
Verification
git diff --check: passed.Verification used installed project executables directly because pnpm attempted to read an npm config denied by the session sandbox. No dependencies were installed or changed.
Review scope
Only the worker transform, its tests, and changeset are included. Existing local demo archive edits and generated images are excluded.
b1209334f1toac811d618b