{"ScriptPreparationCode":"width = 800;\r\nheight = 300;\r\ncanvas = document.getElementById(\u0027c\u0027);\r\ncontext = canvas.getContext(\u00272d\u0027);\r\nbuffer = context.createImageData(width, height);\r\nfor(let i=0;i\u003Cwidth*height;i\u002B\u002B){\r\n buffer.data[i*4\u002B0] = Math.random()*255;\r\n buffer.data[i*4\u002B1] = Math.random()*255;\r\n buffer.data[i*4\u002B2] = Math.random()*255;\r\n buffer.data[i*4\u002B3] = 255;\r\n}","TestCases":[{"Name":"putImageData","Code":"context.putImageData(buffer, 0, 0);","IsDeferred":false},{"Name":"unique fillRect","Code":"for(let y=0;y\u003C300;y\u002B\u002B){\r\n for(let x=0;x\u003C800;x\u002B\u002B){\r\n const offset = (y*width\u002Bx)*4;\r\n context.fillStyle = \u0060rgb(${buffer.data[offset\u002B0]}, ${buffer.data[offset\u002B1]}, ${buffer.data[offset\u002B2]})\u0060;\r\n context.fillRect(x, y, 1, 1);\r\n }\r\n}","IsDeferred":false},{"Name":"2 tone fillRect","Code":"context.fillStyle = \u0060rgb(192, 192, 192)\u0060;\r\n\r\nfor(let y=0;y\u003C300;y\u002B\u002B){\r\n for(let x=0;x\u003C800;x\u002B\u002B){\r\n const offset = (y*width\u002Bx)*4;\r\n if(buffer.data[offset\u002B0]\u003E127){\r\n context.fillRect(x, y, 1, 1);\r\n }\r\n }\r\n}\r\n\r\ncontext.fillStyle = \u0060rgb(64, 64, 64)\u0060;\r\n\r\nfor(let y=0;y\u003C300;y\u002B\u002B){\r\n for(let x=0;x\u003C800;x\u002B\u002B){\r\n const offset = (y*width\u002Bx)*4;\r\n if(buffer.data[offset\u002B0]\u003C128){\r\n context.fillRect(x, y, 1, 1);\r\n }\r\n }\r\n}","IsDeferred":false}]}