canvas = {
const pixScale = 10;
const height = data.ihdr.height
const width = data.ihdr.width
const ctx = DOM.context2d(width * pixScale,height* pixScale);
for (let row = 0; row < width; ++row) {
for (let col = 0; col < height; ++col) {
ctx.beginPath()
ctx.fillStyle = `rgba(${pixs[row*4+col].join(',')})`
console.log(`rgba(${pixs[row*4+col].join(',')})`)
ctx.fillRect(col*pixScale,row*pixScale, pixScale,pixScale);
ctx.fill()
}
}
return ctx.canvas;
}