Scripts to transform the source code of magick-wasm for Deno compatibility.
sh run.sh
To import ImageMagick into your Deno project:
import {
ImageMagick,
IMagickImage,
initialize,
MagickFormat,
} from "https://deno.land/x/imagemagick_deno/mod.ts";
await initialize(); // make sure to initialize first!
const data: Uint8Array = await Deno.readFile("image.jpg");
await ImageMagick.read(data, async (img: IMagickImage) => {
img.resize(200, 100);
img.blur(20, 6);
await img.write(
MagickFormat.Jpeg,
(data: Uint8Array) => Deno.writeFile("image-blur.jpg", data),
);
});
sh run.sh
.deno run -A --no-check test/test.ts
.