https://github.com/lumeland/imagemagick-deno
Deno port of the WASM library for ImageMagick
https://github.com/lumeland/imagemagick-deno
deno imagemagick
Last synced: 4 days ago
JSON representation
Deno port of the WASM library for ImageMagick
- Host: GitHub
- URL: https://github.com/lumeland/imagemagick-deno
- Owner: lumeland
- License: apache-2.0
- Created: 2021-09-10T16:26:16.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-11T22:11:46.000Z (7 months ago)
- Last Synced: 2025-04-12T19:23:31.991Z (14 days ago)
- Topics: deno, imagemagick
- Language: TypeScript
- Homepage: https://deno.land/x/imagemagick_deno
- Size: 58.6 MB
- Stars: 45
- Watchers: 2
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ImageMagick for Deno
Scripts to transform the source code of
[magick-wasm](https://github.com/dlemstra/magick-wasm) for Deno compatibility.```sh
sh run.sh
```To import ImageMagick into your Deno project:
```ts
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),
);
});
```## Build
- Transform the code: `sh run.sh`.
- Test it: `deno run -A --no-check test/test.ts`.