"h": "23d0584c0ec178c1b8e685da5eba9484372027e62b4ebaf72c5576a2472d908a", "id": "620", "a": [ [0,"blue"],[0,"none"],[0,"gold-square"],[0,"empty"],[0,"surprised"] ] } console.log(nfo); // Get the canvas context let ctx = document.getElementById('myCanvas').getContext('2d'); // Disable image smoothing ctx.imageSmoothingEnabled = false; // For each layer for(let i = 0; i < nfo.a.length; i++) { let img = new Image(); // When the image has loaded img.onload = function() { // Draw the image onto the canvas ctx.drawImage(img, 0, 0, 500, 500); } // Set the source of the image to be the base64 string img.src = 'data:image/png;base64,' + nfo.a[i][1]; } }) .catch(err => console.log(err)); // Log any errors </script> </body> </html>