K
K
Kirill Gorelov2018-02-05 16:41:06
JavaScript
Kirill Gorelov, 2018-02-05 16:41:06

Merge-images js (merge two images into one)?

Guys, I need to merge two pictures into one using javascript.
I found such a library https://github.com/lukechilds/merge-images
I do everything as instructed, but I get this error.
Uncaught SyntaxError: Unexpected identifier
I use the code as is.

<script src="https://unpkg.com/merge-images"></script>
<script type="text/javascript">
import mergeImages from 'merge-images';
mergeImages(['body.png', 'eyes.png', 'mouth.png']).then(b64 => document.querySelector('img').src = b64);
</script>
<img src="">


Has anyone encountered this problem or know how to solve it?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question