Readme

Val Town implementation of the magick-wasm demo: https://github.com/dlemstra/magick-wasm/blob/main/demo/demo.ts

Outputs:

ImageMagick 7.1.1-30 Q8 x86_64 dd459b01f:20240407 https://imagemagick.org
Delegates: freetype heic jng jp2 jpeg jxl lcms lqr openexr png raw tiff webp xml zlib
Features: Cipher
Quantum: 8

GIF 100x75 8-bit sRGB
2679
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import {
ImageMagick,
initializeImageMagick,
Magick,
MagickFormat,
Quantum,
} from "https://esm.sh/@imagemagick/magick-wasm";
const resp = await fetch("https://esm.sh/@imagemagick/magick-wasm@0.0.29/dist/magick.wasm");
const wasmBytes = await resp.arrayBuffer();
initializeImageMagick(wasmBytes).then(() => {
console.log(Magick.imageMagickVersion);
console.log("Delegates:", Magick.delegates);
console.log("Features:", Magick.features);
console.log("Quantum:", Quantum.depth);
console.log("");
ImageMagick.read("logo:", image => {
image.resize(100, 100);
image.blur(1, 5);
console.log(image.toString());
image.write(MagickFormat.Jpeg, data => {
console.log(data.length);
});
});
}).catch(err => {
console.error(err);
});
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
v6
June 18, 2024