Skip to content

Add browser support for PNG generation without canvas #14

Description

@davidje13

It is already possible to render to a canvas then call toDataURL, but browsers do not typically optimise these exports very well, leading to large file sizes (for QR codes we only need 2-colour images, but browsers export 32-bit images).

Browsers now support deflate via CompressionStream, so it is practical to support generating PNG files / data URIs on the client-side.

This API is asynchronous, so it cannot be a drop-in replacement for the existing PNG export options available in NodeJS (which provide synchronous APIs)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions