Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lumeland/imagemagick-deno
Deno port of the WASM library for ImageMagick
https://github.com/lumeland/imagemagick-deno
deno imagemagick
Last synced: 2 months ago
JSON representation
Deno port of the WASM library for ImageMagick
- Host: GitHub
- URL: https://github.com/lumeland/imagemagick-deno
- Owner: lumeland
- Created: 2021-09-10T16:26:16.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-28T16:50:17.000Z (over 1 year ago)
- Last Synced: 2024-04-14T05:31:55.543Z (9 months ago)
- Topics: deno, imagemagick
- Language: TypeScript
- Homepage: https://deno.land/x/imagemagick_deno
- Size: 58.6 MB
- Stars: 36
- Watchers: 2
- Forks: 2
- Open Issues: 3
-
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`.