Last active
December 16, 2022 05:00
-
-
Save yoya/8e1fbd6f13d27e1c89e88b5dbdac8195 to your computer and use it in GitHub Desktop.
sample for magick-asm without build tool.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<canvas id="canvasId"> </canvas> | |
<script type="module"> | |
import { ImageMagick, initializeImageMagick } from './node_modules/@imagemagick/magick-wasm/dist/index.mjs'; | |
const canvas = document.getElementById('canvasId') | |
initializeImageMagick().then(() => { | |
ImageMagick.read("logo:", (image) => image.writeToCanvas(canvas)); | |
ImageMagick.readFromCanvas(canvas, (image) => { | |
const degrees = 90 | |
image.rotate(degrees) | |
image.writeToCanvas(canvas) | |
}) | |
}) | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment