UNPKG

500 BHTMLView Raw
1<!DOCTYPE html>
2<html>
3 <head>
4 <title>Jimp browser example 2</title>
5 </head>
6 <body>
7 <h1>
8 Demonstrates loading a relative file using Jimp on a WebWorker thread
9 </h1>
10 <script>
11 var worker = new Worker("jimp-worker.js");
12 worker.onmessage = function (e) {
13 var img = document.createElement("img");
14 img.setAttribute("src", e.data);
15 document.body.appendChild(img);
16 };
17 worker.postMessage("lenna.png");
18 </script>
19 </body>
20</html>