Dither images using wasm plugin

This commit is contained in:
Joscha 2025-03-01 02:17:03 +01:00
parent 179d0653bb
commit 92ec72ab4b
14 changed files with 116 additions and 15 deletions

View file

@ -20,4 +20,14 @@
// the same size after tearing off the paper.
#let feed = v(64pt + 32pt)
#import plugin("plugin.wasm") as plugin
////////////
// Plugin //
////////////
#import plugin("plugin.wasm") as p
#let dither(path) = {
let bytes = read(path, encoding: none)
let dithered = p.dither(bytes)
image(dithered)
}