-
-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathdemo.ts
27 lines (23 loc) · 834 Bytes
/
demo.ts
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
/* Copyright Dirk Lemstra https://github.com/dlemstra/Magick.WASM */
import { initializeImageMagick, ImageMagick } from "../lib/image-magick";
import { Magick } from "../lib/magick";
import { MagickFormat } from "../lib/magick-format";
import { Quantum } from "../lib/quantum";
initializeImageMagick().then(async () => {
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((data) =>
{
console.log(data.length);
}, MagickFormat.Jpeg);
});
}).catch((err) => {
console.error(err);
});