Skip to content

nineff/grayness

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Grayness

This is a proof of concept Typst WASM-plugin to allow simple image editing functions from within Typst, written in Rust. It uses the wasm-minimal-protocol crate to define the plugin functions. The image editing functionality is provided by the image crate.

Usage

The simplest way to use this plugin is to import the package grayness from Typst Universe into your typst code and use it's wrapper functions:

#import "@preview/grayness:0.6.0":*
#let imagedata = read("path-to-your-picture.jpg", encoding: none)
#image-grayscale(imagedata)

The manual provides further details.

You can also use this plugin directly, e.g. if you have compiled the WASM binary yourself.

#let plg = plugin("grayness.wasm")
#let imagedata = read("path-to-your-picture.jpg", encoding: none)
#image(plg.grayscale(imagedata))

Compile

To compile this plugin, you need to have a working Rust toolchain. Then you need to install the wasm32-unknown-unknown target:

rustup target add wasm32-unknown-unknown

Then, build the crate with this target:

cargo build --release --target wasm32-unknown-unknown

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages