Skip to content

Server-side headless PNG rendering (kept out-of-tree) #36

Open

Description

@calumk

Problem

There is no way to turn a saved document (store.getSnapshot()) into a PNG on a Node.js server without launching a browser (Chromium/Puppeteer/Playwright). Any backend that renders, prints, archives or thumbnails boards server-side needs this.

Proposed solution — kept out of this repo

A working implementation lives separately at https://github.com/calumk/quickdrawjs-headless: renderPng(snapshot, { width, height, theme, background, fit, viewport, padding }) returns a PNG Buffer, reusing the core drawShape engine over a native Skia canvas. No browser globals, no automation; 25 tests, docs and a realistic example included.

It is deliberately not proposed as a packages/* addition here: rendering on Skia means shipping native prebuilt-binary dependencies (the Skia engine binaries, BSD-3, via the MIT-licensed skia-canvas wrapper) plus a platform support matrix that this dependency-free core package should not carry.
The chain is permissive (MIT / BSD-3 / OFL), but not MIT.

If it is deemed useful (similar to the react package) let me know, and I can open a PR to move it back to packages.

Why im raising an issue -

To support this, we need a small change to the core.

A tiny, dependency-free seam (no behavior change) - See the PR

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions