Ported from Magick.WASM
This is a beta, there's a lot of features missing, but is a starting point
import {
initializeImageMagick,
ImageMagick,
MagickImage
} from "https://deno.land/x/deno_imagemagick/mod.ts"
await initializeImageMagick(); // make sure to initialize first!
const lena: Uint8Array = await Deno.readFile('lena.jpg');
ImageMagick.read(lena, (img: MagickImage) => {
img.blur(20, 6);
img.resize(200, 100);
img.write((data: Uint8Array) => {
// do something
}, MagickFormat.Jpeg);
});
Make sure to have denon installed.
$ cd demo
$ denon start