putImageData() 메서드는 이미지 데이터를 캔버스에 배치합니다. 캔버스에 애니메이션을 적용하기 위해 메인 루프 외부에 재사용 가능한 ImageData 객체를 생성합니다.
var ct = c.getContext("2d", {alpha: false}); // context without alpha channel.
var a = ct.createImageData(c.width, c.height);
var buffer = new Uint32Array(a.data.buffer);
function loop() {
noise(ct);
requestAnimationFrame(loop)
})()
function noise(ct) {
var l =buffer.length - 1;
while(l--) buffer[l] = Math.random() <0.5 ?0 : -1>>0;
ct.putImageData(a, 0, 0);
}