Skip to content

Allow parsing image from raw bitmap data #2575

@Enivex

Description

@Enivex

Description

I'd like a way to programmatically generate PNGs inside typst from raw pixel values.

While this would technically already be possible using https://typst.app/docs/reference/visualize/image/#definitions-decode it would either 1) involve a plugin or 2) generating a PNG string in pure typst

Use Case

One good example of a place where this would be useful is for the heatmap feature in cetz

cetz-package/cetz#295

This has very poor performance, since it's literally drawing rectangles for each "pixel".

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestNew feature or requestgood contributionSuitable for contribution, but unlike "good first issue", it may need prior experiencescriptingAbout Typst's coding capabilitiesvisualizeRelated to the visualize category, which is about drawing and illustrating

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions